Skip to content

Derive the v4 content_stats type and stats field IDs #1127

Open

Description

@xndai

Iceberg v4 replaces the per-column metric maps (lower_bounds, null_value_counts, ...) with a typed content_stats struct in tracked_file (spec Content Stats, apache/iceberg#14234). Its field IDs are derived from the table schema: each field's stats struct uses the IDs from 10_000 + 200 * field-id, plus a fixed offset per stat, and _last_updated_sequence_number and _row_id use the reserved bases 9000 and 9200. Which stats are present depends on the field type and the table's metrics mode.

Proposal: add a ContentStatsUtil with the stats ID math, the content_stats type a writer uses for a schema and MetricsConfig, and the projection a reader uses for a set of field IDs, matching Java's StatsUtil. The stats values and the bridge to the v1-v3 metric maps would be follow-ups.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions