[ 
https://issues.apache.org/jira/browse/DRILL-7171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16817458#comment-16817458
 ] 

ASF GitHub Bot commented on DRILL-7171:
---------------------------------------

vdiravka commented on pull request #1748: DRILL-7171: Create metadata 
directories cache file in the leaf level directories to support 
ConvertCountToDirectScan optimization.
URL: https://github.com/apache/drill/pull/1748#discussion_r275176370
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/metadata/Metadata.java
 ##########
 @@ -353,22 +353,15 @@ private static boolean 
ignoreReadingMetadata(MetadataContext metaContext, Path p
     writeFile(metadataTableWithRelativePaths.getSummary(), new Path(path, 
METADATA_SUMMARY_FILENAME), fs);
     Metadata_V4.MetadataSummary metadataSummaryWithRelativePaths = 
metadataTableWithRelativePaths.getSummary();
 
-    if (directoryList.size() > 0 && childFiles.size() == 0) {
-      ParquetTableMetadataDirs parquetTableMetadataDirsRelativePaths =
-          new 
ParquetTableMetadataDirs(metadataSummaryWithRelativePaths.directories);
-      writeFile(parquetTableMetadataDirsRelativePaths, new Path(path, 
METADATA_DIRECTORIES_FILENAME), fs);
-      if (timer != null) {
-        logger.debug("Creating metadata files recursively took {} ms", 
timer.elapsed(TimeUnit.MILLISECONDS));
-      }
-      ParquetTableMetadataDirs parquetTableMetadataDirs = new 
ParquetTableMetadataDirs(directoryList);
-      return Pair.of(parquetTableMetadata, parquetTableMetadataDirs);
-    }
-    List<Path> emptyDirList = new ArrayList<>();
+    ParquetTableMetadataDirs parquetTableMetadataDirsRelativePaths =
+        new 
ParquetTableMetadataDirs(metadataSummaryWithRelativePaths.directories);
+    writeFile(parquetTableMetadataDirsRelativePaths, new Path(path, 
METADATA_DIRECTORIES_FILENAME), fs);
     if (timer != null) {
       logger.debug("Creating metadata files recursively took {} ms", 
timer.elapsed(TimeUnit.MILLISECONDS));
       timer.stop();
     }
-    return Pair.of(parquetTableMetadata, new 
ParquetTableMetadataDirs(emptyDirList));
+    ParquetTableMetadataDirs parquetTableMetadataDirs = new 
ParquetTableMetadataDirs(directoryList);
 
 Review comment:
   `parquetTableMetadataDirsRelativePaths` and `parquetTableMetadataDirs` are 
used in one place only.
   I think that objects can be used directly without introducing variables.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Count(*) query on leaf level directory is not reading summary cache file.
> -------------------------------------------------------------------------
>
>                 Key: DRILL-7171
>                 URL: https://issues.apache.org/jira/browse/DRILL-7171
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Venkata Jyothsna Donapati
>            Assignee: Venkata Jyothsna Donapati
>            Priority: Minor
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Since the leaf level directory doesn't store the metadata directories file, 
> while reading summary if the directories cache file is not present, it is 
> assumed that the cache is possibly corrupt and reading of the summary cache 
> file is skipped. Metadata directories cache file should be created at the 
> leaf level.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to