Skip to content

Conversation

@zhjwpku
Copy link
Collaborator

@zhjwpku zhjwpku commented Nov 1, 2025

Result type of Day transform should be int per the spec, but in the Java impl, it is DateType, this discrepancy has been discussed on devlist, see [1]. iceberg-iceberg and iceberg-rust all conform to the java impl, so make iceberg-cpp do the same.

The added comments are borrowed from iceberg-python.

[1] https://lists.apache.org/thread/2gq7b54nvc9q6f1j08l9lnzgm5onkmx5

Result type of Day transform should be `int` per the spec, but in
the Java impl, it is `DateType`, this discrepancy has been discussed
on devlist, see [1]. iceberg-iceberg and iceberg-rust all conform to
the java impl, so make iceberg-cpp do the same.

The added comments are borrowed from iceberg-python.

[1] https://lists.apache.org/thread/2gq7b54nvc9q6f1j08l9lnzgm5onkmx5
@zhjwpku zhjwpku requested review from Fokko and wgtmac November 1, 2025 23:11
{.str = "day",
.source_type = iceberg::timestamp(),
.expected_result_type = iceberg::int32()},
.expected_result_type = iceberg::date()},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding tests for Wire Format Compatibility would be better. The PR changes the return type from int32() to date() but doesn't verify:

  1. That date() values serialize to int32 on the wire
  2. That existing partitioned data files can still be read
  3. That this change is backward compatible with tables partitioned using the old int32 type

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid we don't have fully covered integration test yet. I added a test for PartitionSpec, though I'm not sure if that's sufficient.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SG

@wgtmac wgtmac merged commit 4ebe732 into apache:main Nov 4, 2025
10 checks passed
@zhjwpku zhjwpku deleted the day_transform_return_type_should_be_date branch November 5, 2025 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants