-
Notifications
You must be signed in to change notification settings - Fork 294
fix: Fallback to field.name to get field position when PARQUET:field_id is unavailable #1561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Let's discuss in this issue: #1560 (comment) |
crates/iceberg/src/arrow/value.rs
Outdated
.map(|id| id == field.id) | ||
.unwrap_or(false) | ||
}) | ||
.position(|arrow_field| self.arrow_field_matches_id(arrow_field, field.id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still have misunderstanding here. As I have said #1560 (comment) , for the nan_val_cnt
case, we should match field to arrow array using the field's position(e.g. the rank of this field in struct) rather than by id or name. It's not easy to accomplish with currentl interface, so we should change the interface of PartnerAccessor
, see comments below.
@CTTY Thanks for raising this PR, as suggested in #1560 I think we need to rely on name-mapping here. Iceberg is designed to do operations lazy, meaning that we typically don't rewrite data unless it is neccessary. For example, if you rename a field, it will still find the field with the original name using the field-IDs. This is the case when you have a new table that has the field-IDs correctly set. However, in the age of big-data, and to make it easier for users to migrate to Iceberg, we also support importing existing Parquet files where the field-IDs are missing. In this case, we'll use |
Co-authored-by: Florian Valeye <[email protected]>
Co-authored-by: Renjie Liu <[email protected]>
This reverts commit 8729155.
Which issue does this PR close?
What changes are included in this PR?
Are these changes tested?
Yes, added uts