Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-7565

ANALYZE TABLE ... REFRESH METADATA does not work for empty Parquet files

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.17.0
    • Fix Version/s: 1.18.0
    • Component/s: None
    • Labels:

      Description

      The following query does not create metadata for empty Parquet table:

      @Test
        public void testAnalyzeEmptyParquetTable() throws Exception {
          dirTestWatcher.copyResourceToRoot(Paths.get("parquet", "empty"));
      
          String tableName = "parquet/empty/simple/empty_simple.parquet";
      
          try {
            client.alterSession(ExecConstants.METASTORE_ENABLED, true);
            testBuilder()
                .sqlQuery("ANALYZE TABLE dfs.`%s` REFRESH METADATA", tableName)
                .unOrdered()
                .baselineColumns("ok", "summary")
                .baselineValues(true, String.format("Collected / refreshed metadata for table [dfs.default.%s]", tableName))
                .go();
          } finally {
            run("analyze table dfs.`%s` drop metadata if exists", tableName);
            client.resetSession(ExecConstants.METASTORE_ENABLED);
          }
        }
      

      but yields

      java.lang.AssertionError: Different number of records returned 
      Expected :1
      Actual   :0
      <Click to see difference>
      
      
      	at org.apache.drill.test.DrillTestWrapper.compareResults(DrillTestWrapper.java:862)
      	at org.apache.drill.test.DrillTestWrapper.compareUnorderedResults(DrillTestWrapper.java:567)
      	at org.apache.drill.test.DrillTestWrapper.run(DrillTestWrapper.java:171)
      	at org.apache.drill.test.TestBuilder.go(TestBuilder.java:145)
      	at org.apache.drill.exec.store.parquet.TestEmptyParquet.testSelectWithDisabledMetastore(TestEmptyParquet.java:430)
      	at java.lang.Thread.run(Thread.java:748)
      

      When changing expected result set to empty (TestBuilder#expectsEmptyResultSet()), SHOW TABLES command after ANALYZE TABLE ... does not show any table.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                volodymyr Vova Vysotskyi
                Reporter:
                bohdan Bohdan Kazydub
                Reviewer:
                Bohdan Kazydub
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: