Github user parthchandra commented on a diff in the pull request:
https://github.com/apache/drill/pull/644#discussion_r89031035
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetReaderUtility.java
---
@@ -189,10 +195,16 @@ public static DateCorruptionStatus
detectCorruptDates(ParquetMetadata footer,
String createdBy = footer.getFileMetaData().getCreatedBy();
String drillVersion =
footer.getFileMetaData().getKeyValueMetaData().get(ParquetRecordWriter.DRILL_VERSION_PROPERTY);
- String isDateCorrect =
footer.getFileMetaData().getKeyValueMetaData().get(ParquetRecordWriter.IS_DATE_CORRECT_PROPERTY);
+ String stringWriterVersion =
footer.getFileMetaData().getKeyValueMetaData().get(ParquetRecordWriter.WRITER_VERSION_PROPERTY);
+ // This flag can be present in parquet files which were generated with
1.9.0-SNAPSHOT drill version.
+ // If this flag is present it means that the version of the drill
parquet writer is 2
+ final String isDateCorrectFlag = "is.date.correct";
+ String isDateCorrect =
footer.getFileMetaData().getKeyValueMetaData().get(isDateCorrectFlag);
if (drillVersion != null) {
- return Boolean.valueOf(isDateCorrect) ?
DateCorruptionStatus.META_SHOWS_NO_CORRUPTION
- : DateCorruptionStatus.META_SHOWS_CORRUPTION;
+ int writerVersion = (stringWriterVersion != null) ?
Integer.parseInt(stringWriterVersion)
--- End diff --
Use if-then-else to make this a little easier to read?
---
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.
---