iceberg icon indicating copy to clipboard operation
iceberg copied to clipboard

Ignore partition fields that are dropped from the current-schema

Open Fokko opened this issue 1 year ago • 2 comments

A second attempt to fix this (the first attempt in https://github.com/apache/iceberg/pull/11604 but that one was not safe).

When a field that's dropped that still part of an older partition spec, we currently get an error. See #11842

This will replace it with the UnknownType which will be read as a null. This will work fine, since when the evaluator encounters a null, it will assume that there is no value:

https://github.com/apache/iceberg/blob/dbd7d1c6c32834a8708211f19ad6f6901de5433e/api/src/main/java/org/apache/iceberg/expressions/Projections.java#L204-L207

I misused the UnknownType here, but I think it is better than returning an arbitrary type, like we do in the UnknownTransform:

https://github.com/apache/iceberg/blob/dbd7d1c6c32834a8708211f19ad6f6901de5433e/api/src/main/java/org/apache/iceberg/transforms/UnknownTransform.java#L63-L67

Unfortunately, my first approach, where we drop the field, is incorrect, since V1 tables rely on the order.

Fixes #4563

Fokko avatar Dec 24 '24 06:12 Fokko

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

github-actions[bot] avatar Mar 03 '25 00:03 github-actions[bot]

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

github-actions[bot] avatar May 17 '25 00:05 github-actions[bot]