Github user amansinha100 commented on a diff in the pull request: https://github.com/apache/drill/pull/519#discussion_r67289117 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatPlugin.java --- @@ -208,8 +209,18 @@ public DrillTable isReadable(DrillFileSystem fs, FileSelection selection, FileSystemPlugin fsPlugin, String storageEngineName, String userName) throws IOException { // TODO: we only check the first file for directory reading. - if(selection.containsDirectories(fs)){ - if(isDirReadable(fs, selection.getFirstPath(fs))){ + if(selection.containsDirectories(fs)) { + Path dirMetaPath = new Path(selection.getSelectionRoot(), Metadata.METADATA_DIRECTORIES_FILENAME); + if (fs.exists(dirMetaPath)) { + ParquetTableMetadataDirs mDirs = Metadata.readMetadataDirs(fs, dirMetaPath.toString()); + if (mDirs.getDirectories().size() > 0) { + FileSelection dirSelection = FileSelection.createFromDirectories(mDirs.getDirectories(), selection); + dirSelection.setExpandedPartial(); + return new DynamicDrillTable(fsPlugin, storageEngineName, userName, --- End diff -- I intentionally don't call isDirReadable() here because that method returns true if a metadata cache file exists and I am doing a similar check for the directories file here with fs.exists(dirMetaPath). If this check fails, we will fall through to the old code path (line 223) which does check isDirReadable().
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---