Data: Refactor PartitionStatsHandler#12550
Merged
nastra merged 2 commits intoapache:mainfrom Mar 24, 2025
Merged
Conversation
pvary
reviewed
Mar 17, 2025
data/src/main/java/org/apache/iceberg/data/PartitionStatsHandler.java
Outdated
Show resolved
Hide resolved
pvary
reviewed
Mar 17, 2025
| return id; | ||
| } | ||
| } | ||
| public static final int PARTITION_FIELD_ID = 0; |
Contributor
There was a problem hiding this comment.
Why is this starting with 0? In the previous code the id was started with 1
Member
Author
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
Also, since it is an unreleased feature, modifying this won't cause compatibility issues.
pvary
approved these changes
Mar 19, 2025
Contributor
|
Let's wait a bit for @aokolnychyi, and if he has not time to review, then we can merge this. |
Member
Author
|
@nastra: Can you please take a look? |
nastra
approved these changes
Mar 24, 2025
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.
Replaced Enum with Nested field because Iceberg follows this pattern in other files (Example: DataFile.java)
More info: #11216 (comment)