Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/877#discussion_r127365808
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScan.java
---
@@ -723,19 +723,20 @@ private void init(MetadataContext metaContext) throws
IOException {
// if querying a single file we can look up the metadata directly
from the file
metaPath = new Path(p, Metadata.METADATA_FILENAME);
}
- if (metaPath != null && fs.exists(metaPath)) {
+ if (metaPath != null && fs.exists(metaPath) &&
Metadata.MetadataVersion.isVersionSupported(fs, metaPath)) {
--- End diff --
Nit. No need to check `fs.exists` here as we, in effect, check this when
trying to open the file. Handle the file not found exception instead.
Note that Drill is a multi-user system. Even with the `exists` check, there
is still a race condition where the file can exist during the check, but be
deleted by the time we try to open the file. So, since we have to check on open
anyway, no need to check here.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---