Skip to content

fix(iceberg): honor Parquet compression and encode strings with dictionaries - #32548

Merged
XuPeng-SH merged 10 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/fae86a183809fefdd34bcb49aaf2ce4c5ca65702ba96865fc7ec17ac92f42670
Nov 11, 2026
Merged

XuPeng-SH merged 10 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/fae86a183809fefdd34bcb49aaf2ce4c5ca65702ba96865fc7ec17ac92f42670

Conversation

@iamlinjunhong

@iamlinjunhong iamlinjunhong commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

What this PR does / why we need it:

Iceberg data writes ignored write.parquet.compression-codec and used plain string encoding, producing unnecessarily large files. Propagate the table's codec to append and replacement writers, default to ZSTD, and use dictionary encoding for strings. Bound string input per row group and reuse a limited ZSTD encoder per fanout writer. Compression level and a configurable row-group byte limit are not supported by this change.

Validation:

  • At 701f9a84531dd79b6a16fee3ad7be4cde2779476, relevant package tests, focused race tests, vet and lint passed. Independent file tests covered all six supported codecs and old-format reads. A real Linux SQL append suite passed 10/10, with committed footers and PyIceberg reads for default ZSTD, explicit ZSTD and UNCOMPRESSED. A mixed snapshot of old PLAIN/UNCOMPRESSED and new ZSTD files returned 8,194 rows including NULL through MatrixOne and PyIceberg. The old file came from a baseline writer overlay, not a complete old server. Real INSERT OVERWRITE committed a SNAPPY replacement whose footer, MatrixOne result and normal PyIceberg snapshot scan agreed, including NULL.
  • At 7413b03bb5da564bcf5209146aa503c767398cd5, a targeted real-service public-path check repeated three-table append and committed footer checks, SNAPPY OVERWRITE and a mixed snapshot scan. This was not a rerun of the full 10/10 suite.
  • The only change from 7413b03 to ffebfe3b9c3fa360ad0e7708b46cd40b39f90799 preallocates the 12 local Iceberg E2E setup statements; production service inputs are unchanged. On the final head, Ubuntu/x86 UT, SCA, and CI Required completed successfully. An earlier Ubuntu UT run at 7413b03 failed with several timeouts; its root cause remains undetermined, and the later success does not establish that the preallocation fixed it.

UPDATE committed a SNAPPY replacement and MatrixOne returned the expected values, but PyIceberg 0.12.0 rejected the snapshot's operation=update during metadata loading. The assignment exists in baseline source and the relevant DML package is unchanged; a clean baseline server was not tested. This change does not resolve that metadata limitation or establish that UPDATE snapshots can be scanned by PyIceberg.

Performance depends on data. In a small local eight-partition benchmark, low-cardinality output was 96.1% smaller than the baseline, while wide random strings used about 2.85 times the CPU time and 2.68 times the cumulative allocations. Fixed dictionary encoding has no automatic plain fallback; these measurements are not production throughput or peak-memory guarantees. The 1 MiB string-input limit allows an oversized single row and does not bound total SQL memory. Old binaries reading newly written files, end-to-end backup/restore, and a merge with newer main have not been validated.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify mergify Bot added the kind/bug Something isn't working label Nov 11, 2026
@matrix-meow matrix-meow added the size/L Denotes a PR that changes [500,999] lines label Nov 11, 2026
@mergify

mergify Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Queue requested — the merge queue status continues in this comment ↓.

@XuPeng-SH

XuPeng-SH commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: ffebfe3b9c3fa360ad0e7708b46cd40b39f90799

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: ffebfe3b9c3fa360ad0e7708b46cd40b39f90799

Assessment: approve

Compression settings and default ZSTD now reach append and replacement data files through the existing writer owners. Dictionary encoding, bounded row-group input and shared per-fanout compression state form a coherent fix; failure poisoning preserves commit safety. The fixed-dictionary performance tradeoff is documented and no actionable defect remains.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Reviewed the complete 16-file delta, issue 32466, all three discussion entries, append/UPDATE/MERGE/OVERWRITE propagation, DELETE independence, reader/metadata contracts and abort/orphan paths. discussion-assessment.json covers every discussion key exactly once.

  • Frozen evidence reports successful final-head Ubuntu UT, SCA on arm64, shared build, coverage and both active compose BVT jobs (13 success, 14 skipped, 2 neutral). Iceberg E2E Local was skipped and is not counted as execution proof.

  • Author reports all six codecs, default ZSTD, dictionary round trips, focused race coverage, live append/overwrite and independent Parquet/PyIceberg reads at 701f9a8/7413b03. Compared all PR-owned changed inputs and go.mod/go.sum: only E2E statement-capacity preallocation differs from final head. These remain author-reported results; whole-server integration inputs were not established equal.

  • Supplied preflight passed. Downloaded and inspected exact pinned parquet-go v0.25.1 and klauspost/compress v1.19.0 encoder ownership, concurrency and standard decoding behavior; no product test execution is claimed by that check.

  • Local bounded delivery check passed: frozen clean head/full patch identity, git diff --check, gofmt for 14 changed Go files, checker Python syntax, author-input comparison and exact discussion-key coverage. validation-audit.json matches all three executor receipts to command, source, exit and retained stdout/stderr logs.

Limitations:

  • No local Go product/race suite or live Iceberg service was rerun; raw author/CI execution logs were not supplied. The independent checker was syntax-checked locally, not executed against a catalog.

  • Fixed dictionaries have no adaptive plain fallback. Author measurements report a 96.1% low-cardinality size reduction and 2.85x CPU/2.68x cumulative allocations for wide random strings versus the old uncompressed baseline; these do not establish production throughput or peak-memory equivalence. The 1 MiB string-input bound permits one oversized row and does not bound total SQL memory.

  • Compression-level tuning and configurable row-group byte size remain outside this fix. The disclosed PyIceberg UPDATE snapshot-operation limitation belongs to unchanged baseline DML metadata code; it is not validated as corrected here. No old-binary/new-file or end-to-end backup/restore claim is made.

@mergify mergify Bot added the queued label Nov 11, 2026
@mergify

mergify Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🚫 Left the queue · pull request dequeued

1 h 8 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Wed 11 Nov, 15:55 · rule main · triggered by rule Automatic queue on approval for main
  • ⏹️ Testing stopped · in place
  • 🚫 Left the queue 17:04 · 7996825

Reason

Pull request #32548 has been dequeued

Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.

The author needs to enable "Allow edits from maintainers" on this pull request.

To get back in the queue

  • Push a change if one is needed: the pull request is queued again once its queue conditions match.
  • If no change is needed, tick the box below to queue it again as it is.

Merge conditions not met when it left the queue

  • any of · required by GitHub branch protection:
    • check-neutral = CI Required
    • check-skipped = CI Required
    • check-success = CI Required

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request
2 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection

Times in UTC · dashboard · how the merge queue works

This branch was successfully deployed

No deployments
ci — 79968254 Deployed Nov 11, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dequeued kind/bug Something isn't working size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants