You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Native Iceberg writes: assert manifest metrics parity with iceberg-java for every data type #7639
Part of #5644. One of the conditions for enabling native Iceberg writes by default is manifest metrics parity per data type on the pinned Iceberg versions (1.5.2 is dropped, per the discussion in #5644). Readers such as Spark and Trino prune data files using these metrics, so a wrong bound or count from the native writer can make a reader skip a file that has matching rows.
CometIcebergWriteActionSuite already compares native and iceberg-java metrics through manifestMetricsParity, but only for some types and metrics:
bounds for date, timestamp, timestamp_ntz, decimal(9,2), decimal(38,10), float and binary, and value counts for boolean and bigint;
string bound truncation, metrics mode none, and sorted-column bounds under counts;
NaN counts for float and double, in separate tests.
Not covered yet: null counts across types; bounds for int, bigint, double, boolean and short strings; INT64-backed decimals (precision 10 to 18); all-null columns; and leaf columns inside structs, lists and maps.
Describe the potential solution
Parity tests per group of types, built on manifestMetricsParity. Each one writes the same rows, including nulls and NaN where they apply, through the native and the iceberg-java writer, and compares per column value_count, null_value_count, nan_value_count, lower_bound and upper_bound from readable_metrics.
Types: boolean, int, bigint, float, double, decimals backed by INT32, INT64 and fixed-length binary, date, timestamp, timestamp_ntz, string, binary, and leaf columns inside struct, list and map where iceberg-java records metrics for them.
column_sizes is left out, because the two writers lay out files differently.
The tests go in Comet's own suite, so they run under each Spark profile's pinned Iceberg version: 1.8.1 (Spark 3.5), 1.10.0 (Spark 4.0) and 1.11.0 (Spark 4.1). Each mismatch they find gets its own issue, since a fix may be on the native side, and the test for that type references it until it's fixed.
Additional context
Coverage summary is from CometIcebergWriteActionSuite on main at 983173e.
Native writes don't keep iceberg-rust's metrics: rebuildDataFilesWithJavaMetrics re-reads each footer and runs the version-matched ParquetUtil.footerMetrics with MetricsConfig.forTable. Modes, truncation and the list/map rules are iceberg-java's code on both paths. What can still differ is the input: footer statistics from parquet-rs instead of parquet-java, and the float/double metrics carried over from iceberg-rust.
Checked one candidate first: parquet-java leaves a chunk's statistics out of the file when min + max reach 4096 bytes, and the native writer keeps them. The manifests still match, because iceberg-java takes its metrics from the footer it holds in memory. The test (77af0bf) writes 2047- and 2048-byte strings and binary, plus one column under full so the whole value is compared, and passes on 1.8.1 and 1.11.0. The files themselves do differ there (only native files carry those statistics), which the docs' list of physical differences doesn't mention yet; I can add a line in the PR.
Next: a helper that compares the raw data_files maps (value/null/NaN counts, bounds) per field id, file by file, with the two documented divergences (zero sign, float counts under a NULL struct on 1.9+) handled explicitly. Groups: integers/boolean/dates/timestamps, decimals (INT32, INT64, fixed, and decimal(1, s)), strings/binary across metrics modes, all-NULL columns and several row groups, nested leaves, metrics config, plus one partitioned and one copy-on-write write. UUID stays out until feat: support native Iceberg UUID writes #7198 lands.
The PR CI runs only Spark 4.1, so I'll run 3.5 and 4.0 locally and ask for run-all-spark-profiles on the PR. @andygrove could item about manifest metrics parity in #5644 point to this issue?
Activity
Visorgood commentedon Nov 16, 2026
take
Visorgood commentedon Nov 22, 2026
Plan after reading the write path:
rebuildDataFilesWithJavaMetricsre-reads each footer and runs the version-matchedParquetUtil.footerMetricswithMetricsConfig.forTable. Modes, truncation and the list/map rules are iceberg-java's code on both paths. What can still differ is the input: footer statistics from parquet-rs instead of parquet-java, and the float/double metrics carried over from iceberg-rust.fullso the whole value is compared, and passes on 1.8.1 and 1.11.0. The files themselves do differ there (only native files carry those statistics), which the docs' list of physical differences doesn't mention yet; I can add a line in the PR.data_filesmaps (value/null/NaN counts, bounds) per field id, file by file, with the two documented divergences (zero sign, float counts under a NULL struct on 1.9+) handled explicitly. Groups: integers/boolean/dates/timestamps, decimals (INT32, INT64, fixed, anddecimal(1, s)), strings/binary across metrics modes, all-NULL columns and several row groups, nested leaves, metrics config, plus one partitioned and one copy-on-write write. UUID stays out until feat: support native Iceberg UUID writes #7198 lands.The PR CI runs only Spark 4.1, so I'll run 3.5 and 4.0 locally and ask for
run-all-spark-profileson the PR. @andygrove could item about manifest metrics parity in #5644 point to this issue?