[ https://issues.apache.org/jira/browse/DRILL-7063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16811934#comment-16811934 ]
ASF GitHub Bot commented on DRILL-7063: --------------------------------------- Ben-Zvi commented on pull request #1723: DRILL-7063: Seperate metadata cache file into summary, file metadata URL: https://github.com/apache/drill/pull/1723#discussion_r272844226 ########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetTableMetadataProviderImpl.java ########## @@ -109,19 +108,57 @@ public Path getSelectionRoot() { return selectionRoot; } + /** + * Returns list of metadata cache files + * @param p directory path of the cache file + * @param fs filesystem object + * @return list of cache files found in the given directory path + */ + public List<Path> populateMetaPaths(Path p, DrillFileSystem fs) throws IOException { + List<Path> metaFilepaths = new ArrayList<>(); + for (String filename : Metadata.CURRENT_METADATA_FILENAMES) { + metaFilepaths.add(new Path(p, filename)); + } + for (String filename : Metadata.OLD_METADATA_FILENAMES) { + // Read the older version of metadata file if the current version of metadata cache files donot exist. + if (fileExists(fs, metaFilepaths)) { + return metaFilepaths; + } + metaFilepaths.clear(); + metaFilepaths.add(new Path(p, filename)); + } + if (fileExists(fs, metaFilepaths)) { + return metaFilepaths; + } + return new ArrayList<>(); + } + + public boolean fileExists(DrillFileSystem fs, List<Path> paths) throws IOException { + if (paths.isEmpty()) { + return true; + } Review comment: very minor - if "paths" is empty, then the following for-loop would not iterate and "true" would be returned anyway. So this "if" statement is redundant. ---------------------------------------------------------------- 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: us...@infra.apache.org > Create separate summary file for schema, totalRowCount, totalNullCount > (includes maintenance) > --------------------------------------------------------------------------------------------- > > Key: DRILL-7063 > URL: https://issues.apache.org/jira/browse/DRILL-7063 > Project: Apache Drill > Issue Type: Sub-task > Components: Metadata > Reporter: Venkata Jyothsna Donapati > Assignee: Venkata Jyothsna Donapati > Priority: Major > Fix For: 1.16.0 > > Original Estimate: 252h > Remaining Estimate: 252h > -- This message was sent by Atlassian JIRA (v7.6.3#76005)