the-other-tim-brown opened a new issue, #1059: URL: https://github.com/apache/incubator-xtable/issues/1059
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/incubator-xtable/issues?q=is%3Aissue) and found no similar issues. ### Please describe the bug 🐞 `IcebergColumnStatsConverter.toIceberg` passes `TIMESTAMP` and `TIMESTAMP_NTZ` stats straight to `Conversions.toByteBuffer`. Iceberg timestamps are micros since epoch, but XTable stores these stats as millis or micros, depending on the field's `TIMESTAMP_PRECISION`. For a millisecond column the Iceberg target writes lower and upper bounds 1000 times too small, in January 1970, so Iceberg can skip data files that have matching rows. Millisecond stats come from the Hudi source (Avro `timestamp-millis`, `local-timestamp-millis`), the Paimon source (`TIMESTAMP(3)`) and the Parquet source (`TIMESTAMP(MILLIS)`). Partition values are not affected: `IcebergPartitionValueConverter` already converts millis to micros. #1017 is the same bug in the Delta Kernel target. To reproduce: 1. Create a Hudi table with a `timestamp-millis` column, for example `TestSparkHudiTable.forStandardSchemaAndPartitioning` (`timestamp_millis_nullable_field`), and insert rows. 2. Sync it to Iceberg with `ConversionController`. 3. Read the data file bounds for the column from the Iceberg manifests. They are 1000 times too small, in January 1970. A filtered Spark read of the Iceberg target also returns no rows for `timestamp_millis_nullable_field >= timestamp_millis(<two days ago>)`, against 74 from the source. Even with correct manifest bounds, Iceberg's Parquet row-group filter compares the raw `TIMESTAMP_MILLIS` footer stats with micros literals and prunes the row groups: https://github.com/apache/iceberg/issues/18173 (fix in review: https://github.com/apache/iceberg/pull/18321). That part is outside XTable. Expected behavior: the Iceberg target writes timestamp bounds in micros for millisecond columns. ### Are you willing to submit PR? - [X] I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- 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]
