Skip to content

API, Core: Align offsets of field stats with Design doc / Spec#15432

Merged
huaxingao merged 1 commit intoapache:mainfrom
nastra:content-stats-update-offsets
Feb 25, 2026
Merged

API, Core: Align offsets of field stats with Design doc / Spec#15432
huaxingao merged 1 commit intoapache:mainfrom
nastra:content-stats-update-offsets

Conversation

@nastra
Copy link
Contributor

@nastra nastra commented Feb 24, 2026

This aligns the offsets in the impl with the offets mentioned in the design doc and the Spec. The offsets are starting at 1 and are describing the offset of the field ID from the base stats structure, whereas the Java impl was using the offsets based on their position (0-based) within the stats structure.

}

public static Types.StructType fieldStatsFor(Type type, int fieldId) {
public static Types.StructType fieldStatsFor(Type type, int baseFieldId) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we used to always pass baseFieldId + 1 here instead of just the baseFieldId

@nastra nastra requested review from Fokko and danielcweeks February 24, 2026 14:56
@nastra nastra force-pushed the content-stats-update-offsets branch from 139be61 to 87bc9cf Compare February 24, 2026 15:15
Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch @nastra 🙌

@nastra nastra force-pushed the content-stats-update-offsets branch from 87bc9cf to 1c10620 Compare February 25, 2026 07:07
@nastra nastra force-pushed the content-stats-update-offsets branch from 1c10620 to a1f72f2 Compare February 25, 2026 07:08
@nastra nastra added this to the Iceberg 1.11.0 milestone Feb 25, 2026
@huaxingao huaxingao merged commit 17891bc into apache:main Feb 25, 2026
35 checks passed
@huaxingao
Copy link
Contributor

Thanks @nastra for the PR! Thanks @Fokko @stevenzwu for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants