rdblue opened a new pull request, #17159: URL: https://github.com/apache/iceberg/pull/17159
This updates the content stats API and implementations used for columnar stats in v4. API changes: * Removes `StructLike` used for serialization from the interfaces * Adds `copy` methods to support copying `TrackedFile` with stats * Aligns interface conventions (use `Iterable`, expose full struct type as `type`, etc.) `StatsUtil` changes: * Reduce complexity of ID methods, reduce number of constants * Remove `FieldStatistic` enum; not all offsets were represented as `FieldStatistic` and it also embedded util methods. All utils are now in `StatsUtil`. * Avoid double `switch` statement to resolve position to enum and enum to field in `FieldStatsStruct` `get` and `set` * Simplified field stats struct generation * Replaced content stats schema visitor with a loop * Added stats schema generation for read path based on field IDs * Added stats schema generation for write path based on `MetricsConfig` `ContentStats` implementation changes: * Rename to `ContentStatsStruct` to align with other v4 types * Implement `StructLike` methods without copying data to allow object reuse, do not rebuild field stats * Use `setCustomType` instead of copying via builder in `set` * Keep field stats in a map rather than syncing between list and map * Remove unnecessary builder * Fix raw types suppressions `FieldStats` implementation changes: * Rename to `FieldStatsStruct` to align with other v4 types * Remove `SupportsIndexProjection` that is bypassed * Implement `get` and `set` projection directly based on offset, do not rely on mapping passed to constructor * Use internal get/set to avoid duplicated `javaClass.cast` * Remove `equals` and `hashCode` * Remove unnecessary builder Test changes: * Separated `StatsUtil` test values from production constants * Aligned implementation tests with other v4 object tests (test accessors, get, set, projection, serialization, and copy) * Updated tests that depend on stats classes -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
