Skip to content

[EPIC] Nested types in the native Parquet and Iceberg writers: correctness and performance follow-ups #7051

Open

Description

@andygrove

What is the problem the feature request solves?

Nested types (structs, arrays and maps) in the native Parquet writer and the native Iceberg writer were audited on main at c230bf4, as #7040 did for the scans. The audit looked at NULL structs, arrays and maps, NULLs inside them, field ids at every level, Parquet statistics and Iceberg manifest metrics. Each write was made twice, once natively and once by Spark with Comet disabled, and the two were compared on the values read back, the Parquet schema and footer, the column statistics, the manifest metrics and the files pruned for nested predicates. Parquet writes ran on Spark 3.4.3, 3.5.9 and 4.1.3, and Iceberg writes on Iceberg 1.5.2, 1.8.1 and 1.11.0. A code review of both writers, arrow-rs 59.3 and iceberg-rust at the current pin ran alongside, and each finding below was reproduced before it was listed.

Both writers write nested data correctly. What remains are Spark settings the native Parquet writer ignores, a fallback that keeps writes into NOT NULL Iceberg columns off the native path, and one wrong statement in the docs. This epic collects the new issues and the related ones that were already open. Items are listed by priority within each section.

Correctness: native Parquet writer

Performance and coverage: native Iceberg writer

Performance: both writers

Documentation

Related epics

Describe the potential solution

Each item is a linked issue. Check it here when it closes.

Additional context

Differences that are not Comet bugs, listed so they are not refiled:

What matched: values, Parquet repetition, field ids and column statistics for NULL structs, arrays and maps, empty arrays and maps, and NULLs inside them at every level, in deep and wide schemas. That includes input sliced by LIMIT and OFFSET, filtered input, and nested values computed by expressions before the write. Parquet field ids at every level, with spark.sql.parquet.fieldId.write.enabled on and off. Nested timestamp, decimal, boolean and binary leaves. Iceberg manifest metrics (value, null and NaN counts, lower and upper bounds) under the default and full modes on all three Iceberg versions, and on 1.11.0 also under counts, truncate(4), per-column overrides on nested fields, max-inferred-column-defaults and tiny pages and row groups. Nested partition sources (identity on s.a, bucket, truncate and days(ts.t)), a sort order on a nested field, and copy-on-write DELETE, UPDATE and MERGE. Required nested fields under NULL parents written straight from a native scan, and fixed fields under NULL structs. Natively written files with pre-1582 values read back correctly by Comet's own scan.

Not covered: Variant (#5433), partitioned and bucketed native Parquet writes (#3193, #3194), object-store and HDFS outputs, Iceberg format v3 types, encryption, and write throughput. The probes ran against a debug build, and #6911 profiles a release build.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions