Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/644#discussion_r86387810
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetReaderUtility.java
 ---
    @@ -214,14 +218,24 @@ public static DateCorruptionStatus 
detectCorruptDates(ParquetMetadata footer,
               }
               // written by a tool that wasn't Drill, the dates are not 
corrupted
               return DateCorruptionStatus.META_SHOWS_NO_CORRUPTION;
    -        } catch (VersionParser.VersionParseException e) {
    -          // If we couldn't parse "created by" field, check column 
metadata of date columns
    -          return checkForCorruptDateValuesInStatistics(footer, columns, 
autoCorrectCorruptDates);
             }
           }
    +    } catch (VersionParser.VersionParseException e) {
    +      // If we couldn't parse "created by" or "drill version", check 
column metadata of date columns
    +      return checkForCorruptDateValuesInStatistics(footer, columns, 
autoCorrectCorruptDates);
         }
       }
     
    +  public static boolean isDrillVersionHasCorrectDates(String drillVersion) 
throws VersionParser.VersionParseException {
    +    VersionParser.ParsedVersion parsedDrillVersion = 
parseDrillVersion(drillVersion);
    +    SemanticVersion semVer = parsedDrillVersion.getSemanticVersion();
    +    // true for 1.9.0, 2.0.0-SNAPSHOT, 2.0.0 
etc. (false for 1.9.0-SNAPSHOT, 
1.8.0, 1.8.0-SANPSHOT etc.)
    +    return semVer != null && semVer.compareTo(new SemanticVersion(1, 9, 
0)) >= 0;
    +  }
    +
    +  public static VersionParser.ParsedVersion parseDrillVersion(String 
drillVersion) throws VersionParser.VersionParseException {
    +    return VersionParser.parse("drill version " + drillVersion + " (build 
1234)");
    --- End diff --
    
    The " (build 1234)" deserves some explanation. Does the parse function 
demand it so that we have to make up something here just to get the version to 
parse?


---
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.
---

Reply via email to