← Back to Pull requests

feat: translate parquet.enable.dictionary for native Iceberg writes #7775

Open
unknown opened this pull request with 304 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 28, 2026 16:20 UTC
Author

Which issue does this PR close?

Part of #6954.

Rationale for this change

Setting parquet.enable.dictionary currently causes native Iceberg writes to fall back to iceberg-java, even though parquet-rs already supports disabling dictionary encoding via WriterProperties::set_dictionary_enabled(false).

In iceberg-java, Parquet.WriteBuilder reads parquet.enable.dictionary from table/write properties using PropertyUtil.propertyAsBoolean (Boolean.parseBoolean semantics, defaulting to true when unset) and ignores it when set in Hadoop configuration. Supporting this directly avoids unnecessary fallbacks when dictionary encoding is disabled.

What changes are included in this PR?

  • Vetting & Proto Translation: Removed the parquet.enable.dictionary fallback check in CometIcebergNativeWrite, added dictionary_enabled to IcebergParquetWriteSettings in operator.proto, and translated the property in IcebergWriteProtoTranslation matching Boolean.parseBoolean semantics.

  • Native Writer: Passed settings.dictionary_enabled to WriterProperties::set_dictionary_enabled(...) in build_writer_properties and skipped DictionaryChooser sampling/selection when dictionary encoding is disabled.

  • Tests:

  • - Added Rust unit tests in iceberg_dictionary.rs and iceberg_write.rs.
    - Added translation unit tests in IcebergWriteProtoTranslationSuite.
    - Updated CometIcebergWriteDetectionSuite to verify Compatible detection for table properties and write options.
    - Updated CometIcebergWriteActionSuite key classification and added a both-writers comparison test (parquet.enable.dictionary=false) checking output rows, readable_metrics, and column chunk encodings.
  • Docs: Added parquet.enable.dictionary to the native Iceberg write eligibility table in docs/source/user-guide/latest/iceberg.md and removed it from the #6954 fallback list.
  • How are these changes tested?

  • Rust unit tests: cargo test -p datafusion-comet --lib iceberg_dictionary and cargo test -p datafusion-comet --lib iceberg_write

  • JVM suites: IcebergWriteProtoTranslationSuite, CometIcebergWriteDetectionSuite, and CometIcebergWriteActionSuite

  • Formatting and lint checks: cargo fmt --check, cargo clippy --all-targets --workspace -- -D warnings, ./mvnw spotless:check, scalastyle:check, Prettier, Apache RAT, and -Pspark-3.5,delta -Pstrict-warnings compilation
  • Diff: 304 lines (+228 / -76) across 3 files Reviewer: comphead Review duration: 3243m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 304 lines diff across 3 files
    0.40
    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%
    46%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.342
    Real PR Conversation Timeline
    1 comments
    "Review active on #7775"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 40.1% (MEDIUM) · Higher = larger blast radius
    40.1%
    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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 21.4% · Safe to merge
    21.4%