Repository navigation
Conversation
Avro's local-timestamp-millis and local-timestamp-micros were converted to LONG, since Hudi 0.x wrote them to Parquet as plain INT64. Hudi 1.x writes them as Parquet timestamps that are not adjusted to UTC. The Iceberg schema of a table with a TIMESTAMP_NTZ column therefore said long for a column whose files hold a timestamp, and every Iceberg read of the table failed with a ClassCastException from LongType to TimestampType. Both logical types now convert to TIMESTAMP_NTZ and keep their precision, which the Iceberg schema extractor already turns into a timestamp without zone. TestAvroSchemaConverter expects the new type, and a new case in TestHudiSchemaExtractor converts a Hudi schema with both logical types to the internal schema and on to Iceberg. The helpers of ITIcebergTableFormat and ITConversionController that pick the columns to compare read these columns from Iceberg as longs and now read them as timestamps, as they do from Hudi.
The Delta target now writes Hudi's local timestamp columns as TIMESTAMP_NTZ, while the comparison in ITConversionController converted them to epoch values for Hudi and Iceberg only, so every Hudi to Delta comparison of these columns compared epoch numbers with timestamps of the same instants. The Delta side now goes through the same conversion.
yihua
force-pushed
the
ptf-review-avro-local-timestamps
branch
from
November 24, 2026 20:56
4125a7b to
6161978
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important Read
Issue: apache#1048, part of apache#722. Based on #8; review that first. The change is already on
iceberg-v3-ptf-poc, which is not meant to land as one PR, so this PR carries one area of it for review. The commits marked self-review below fix what review of this slice found; they are not oniceberg-v3-ptf-pocyet.What is the purpose of the pull request
Avro
local-timestamp-millisandlocal-timestamp-microsconvert to TIMESTAMP_NTZ with their precision instead of LONG, since Hudi 1.x writes them as Parquet timestamps not adjusted to UTC and Iceberg reads of such tables failed with a ClassCastException.Brief change log
AvroSchemaConvertermaps both logical types to TIMESTAMP_NTZ.ITIcebergTableFormatandITConversionControllerread these columns as timestamps from Hudi and Iceberg.ITConversionControllercompared epoch numbers with timestamps of the same instants.Known limitations:
timestampNtztable feature.Verify this pull request
This change added tests and can be verified as follows:
TestAvroSchemaConverterexpects the new type, and a new case inTestHudiSchemaExtractorconverts a Hudi schema with both logical types to the internal schema and on to Iceberg.ITConversionControllerandITIcebergTableFormatcompare the columns across formats.xtable-coreunit tests pass, all 80ITConversionControllercases pass with the self-review commit (34 Hudi to Delta cases failed without it), and the Iceberg table format's 26 unit tests and 46 ITs pass (1 skipped).ITConversionControllerran with at most four concurrent cases, which [902] Build on Java 17, Spark 3.5, Iceberg 1.12 and Hudi 1.3.0-SNAPSHOT, with a Spark 4.1 profile #8 now sets forxtable-core, on the default 1.5 GB test heap.