← Back to Pull requests

feat: translate parquet.columnindex.truncate.length for native Iceberg writes #7776

Open
unknown opened this pull request with 475 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 29, 2026 00:08 UTC
Author

Which issue does this PR close?

Part of #6954 (one of the settings listed there; parquet.enable.dictionary is handled separately).

Rationale for this change

iceberg-java's ParquetWriter reads parquet.columnindex.truncate.length (default 64) from its writer's Hadoop configuration, into which it copies the table and write properties. The native writer ignored it, so the gate declined every write that set the key, although parquet-rs has a direct equivalent (WriterProperties::set_column_index_truncate_length).

What changes are included in this PR?

  • Proto: IcebergParquetWriteSettings.column_index_truncate_length.

  • Translation (IcebergWriteProtoTranslation): resolves the key from the effective table/write properties the way Hadoop's Configuration.getInt reads a decimal (trimmed, optional +), defaulting to iceberg-java's 64. columnIndexTruncateLengthRejection declines 0, negative values, overflow, and values getInt reads but the translation does not (hex, ${var}).

  • Gate (CometIcebergNativeWrite): admits the key as a table or write property. UnsupportedParquetMrKeys becomes ParquetMrKeysReadByWriter; a key set only in the session or FileIO Hadoop configuration still falls back, because iceberg-java sets the table/write properties over that configuration and the effective value there depends on the FileIO.

  • Native (build_writer_properties): passes the value to parquet-rs. A zero returns an error instead of reaching parquet-rs's assert!, so no panic can cross JNI.

  • Docs: eligibility table row, the parquet. paragraph and the fallback plan list in the user guide; contributor guide updated for the renamed set. A new accepted divergence documents how parquet-mr's BinaryTruncator and parquet-rs truncate column index bounds differently (raising a truncated non-ASCII string upper bound; binary/fixed columns without a logical type). Both produce valid bounds, so page pruning stays correct. The difference already exists at the default length of 64; a smaller length makes it reachable on shorter values.
  • No new config keys. Manifest metrics are unaffected: they are rebuilt from footer statistics, which this setting does not touch.

    How are these changes tested?

  • CometIcebergWriteActionSuite: writes the same rows through the native and iceberg-java writers with a length of 8. It asserts that rows and readable_metrics match, and that every page's column index min/max is identical across the two writers and truncated to 8 bytes.

  • CometIcebergWriteActionSuite: for the documented divergence, writes multi-byte UTF-8 strings (including a 4-byte code point straddling the cut) and binary values (valid UTF-8, invalid UTF-8, plain bytes) with a length of 4. For each writer it asserts the bounds are truncated to 4 bytes and contain every value of the page, so pruning stays correct even though the two writers' bytes differ.

  • CometIcebergWriteDetectionSuite: a valid table property is Compatible; 0 and hex fall back; the key in the session Hadoop configuration alone still falls back; a table property overriding it is Compatible. The existing catalog hadoop. override test still falls back.

  • IcebergWriteProtoTranslationSuite: default, accepted spellings (" 16 ", +32, 0064) and rejected ones (0, -1, 0x20, ${len}, abc, empty, 2147483648).

  • Rust: translates_column_index_truncate_length, rejects_zero_column_index_truncate_length.
  • Run locally (Spark 4.1 default profile, JDK 17): the three suites above (the Action suite filtered to its parquet tests, including the parquet-mr key classification test), iceberg_write Rust tests, cargo clippy --all-targets --workspace -D warnings, cargo fmt, spotless, and the semantic scalafix check.

    Diff: 475 lines (+356 / -119) across 5 files Reviewer: comphead Review duration: 2775m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.46) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 475 lines diff across 5 files
    0.46
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.369
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #7776"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.7% (MEDIUM) · Higher = larger blast radius
    45.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 26.1% · Safe to merge
    26.1%