the-other-tim-brown opened a new pull request, #1060: URL: https://github.com/apache/incubator-xtable/pull/1060
Fixes #1059 ## What is the purpose of the pull request The Iceberg target wrote the column stats of millisecond timestamp columns as if they were micros, so the lower and upper bounds landed in January 1970 and Iceberg could skip data files with matching rows. This PR converts millis to micros before writing the bounds. It is the same bug #1018 fixes for the Delta Kernel target. ## Brief change log - `IcebergColumnStatsConverter`: `TIMESTAMP` and `TIMESTAMP_NTZ` bounds are converted to micros when the field's `TIMESTAMP_PRECISION` is `MILLIS`. Partition values already did this. - `TestIcebergColumnStatsConverter#testTimestampBoundsUseFieldPrecision`: bounds for `TIMESTAMP` and `TIMESTAMP_NTZ`, with millis and micros precision. - `GenericTable#getTimestampColumn`: a timestamp column for each test table. - `ITConversionController#testVariousOperations`: also checks that a filtered read on that timestamp column returns the same rows from every target as from the source. It runs for the Hudi, Delta, Iceberg and Paimon sources. The Hudi to Iceberg case is skipped for the timestamp filter. Even with correct manifest bounds, Iceberg's Parquet row-group filter compares Hudi's raw `TIMESTAMP_MILLIS` footer stats with micros literals and prunes every row group, so the read returns 0 rows: apache/iceberg#18173, with a fix in review in apache/iceberg#18321. The skip can be removed once XTable uses an Iceberg release with that fix. ## Verify this pull request This change added tests and can be verified as follows: - `TestIcebergColumnStatsConverter#testTimestampBoundsUseFieldPrecision` fails on `main` (`ts_millis ==> expected: <1710498030123000> but was: <1710498030123>`) and passes with the fix. - `ITConversionController#testVariousOperations`: 28 run, 0 failures. - On `main`, the new timestamp filter check in `testVariousOperationsDeltaKernelTarget` fails for the Kernel target (57 rows from the source, 0 from the target). That check is left out of this PR so it doesn't fail before #1018 merges. It could replace the new IT in #1018. Tables already written by the Iceberg target keep the old bounds on files that were already synced. Running a full sync rewrites them. -- 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]
