Repository navigation
Conversation
This branch has not been deployed
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.
Which issue does this PR close?
What changes are included in this PR?
type_promotion_is_validin the field-id projection path had no arm for the v3date->timestamp/timestamp_nspromotions. When another column was projected in the same read, the date leaf was left out of the projection mask, so the column came back as NULL (or failed withMissing required fieldwhen required). Projecting it alone happened to work only because the mask fell back toProjectionMask::all().This adds the two promotions to the match, so the leaf is read and
RecordBatchTransformercasts it as it already does in the single-column case.The out-of-range case from the issue (a date that overflows
timestamp_nsreads as NULL instead of failing) comes from the safe cast in thePromotepath and is not addressed here.Are these changes tested?
Yes. A new test in
arrow::reader::projectionwrites a file with twodatecolumns and anintcolumn and reads it through a schema that promotes them to optionaltimestampand requiredtimestamp_ns, projecting all three. It fails on main (the required column is reported missing) and passes with the change. Theiceberglib tests and clippy pass locally.AI Disclosure
I used an AI assistant to help locate the cause and write the test, then reviewed and ran it myself. The fix follows the one suggested in the issue. One thing worth a look: the match does not check the table's format version, same as the existing int/float/decimal arms, so a pre-v3 table with this promotion would also be read rather than rejected.