-
Notifications
You must be signed in to change notification settings - Fork 3k
Data: Refactor PartitionStatsHandler #12550
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
Conversation
data/src/main/java/org/apache/iceberg/data/PartitionStatsHandler.java
Outdated
Show resolved
Hide resolved
| return id; | ||
| } | ||
| } | ||
| public static final int PARTITION_FIELD_ID = 0; |
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.
Why is this starting with 0? In the previous code the id was started with 1
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.
PartitionStats.set(pos, value) was based on enum ordinal before (starts from zero).
Now that we don't have ordinal, I have used field_id instead as field_id-1 may look odd.
I even thought of updating the PartitionStats.set(pos, value) to set from 1, but all of the places Structlike starts from 0. So, didn't went with that path.
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.
Also, since it is an unreleased feature, modifying this won't cause compatibility issues.
|
Let's wait a bit for @aokolnychyi, and if he has not time to review, then we can merge this. |
|
@nastra: Can you please take a look? |
Replaced Enum with Nested field because Iceberg follows this pattern in other files (Example: DataFile.java)
More info: #11216 (comment)