yihua opened a new pull request, #1052: URL: https://github.com/apache/incubator-xtable/pull/1052
## *Important Read* Closes #1047, part of #722. ## What is the purpose of the pull request The path based partition values extractor parses DATE partition paths written as ISO dates and TIMESTAMP paths written as escaped dates and times, instead of failing with a NumberFormatException. Since Hudi's SQL key generator truncates a TIMESTAMP path to whole seconds, a data file whose column stats show a value other than its path value is refused rather than published with a wrong partition value. ## Brief change log - `PathBasedPartitionValuesExtractor` parses both forms into the field's precision; numbers are read as before. - `HudiDataFileExtractor` checks the stats of identity TIMESTAMP partition columns. - A file without stats for the column is kept, since the column may be outside the indexed columns. Known limitations: - **behavior change for all targets:** a Hudi table partitioned by a TIMESTAMP column with sub-second values, or several values per second, now fails its sync. - An escaped timestamp path without an offset is read in the JVM's default time zone, which has to match the writer's. ## Verify this pull request This change added tests and can be verified as follows: - `TestHudiPartitionValuesExtractor` parses twelve paths: dates before and after the epoch as dates and as numbers, and timestamps that are escaped, carry a fraction or an offset, are numbers, or have millis, micros or no declared precision, with and without a time zone; invalid values fail with a `PartitionValuesExtractorException`. `TestHudiDataFileExtractor` keeps a file whose only value is the path value, a null partition and a file without stats for the column, and refuses a value with fractional seconds and two values of one second. - Run locally on JDK 11: 611 `xtable-core` unit tests pass (3 skipped), the `xtable-core` Iceberg ITs pass, and the Iceberg table format's 26 unit tests and 46 ITs pass (1 skipped). -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
