Skip to content

Support deletion vector merge-on-read - #706

Merged
JingsongLi merged 1 commit into
apache:mainfrom
JingsongLi:codex/dv-merge-on-read
Aug 12, 2026
Merged

Support deletion vector merge-on-read#706
JingsongLi merged 1 commit into
apache:mainfrom
JingsongLi:codex/dv-merge-on-read

Conversation

@JingsongLi

Copy link
Copy Markdown
Contributor

What changed

  • support deletion-vectors.merge-on-read=true for deduplicate primary-key batch snapshot reads
  • include level-0 files, preserve overlapping key ranges in one split, and apply deletion vectors before key merging
  • keep non-key predicates out of pre-merge file pruning and enforce them after merging
  • load deletion vectors lazily per physical file and cap DV merge fan-in at 256 sorted runs
  • match Java behavior by treating merge-on-read as an ignored option when deletion vectors are disabled
  • document the option and add core plus DataFusion regression coverage

Why

Deletion-vector tables normally hide uncompacted level-0 files until compaction. Java Paimon allows batch readers to opt into merge-on-read so recent level-0 data is visible immediately. The Rust reader parsed the option but did not implement the corresponding scan and read path.

Impact

Deduplicate primary-key tables with deletion vectors can now expose uncompacted data in batch snapshot queries while preserving primary-key, deletion-vector, and residual-filter correctness. The default remains unchanged. Streaming and changelog behavior are not affected, and partial-update or aggregation with DV merge-on-read remain unsupported.

Validation

  • cargo test -p paimon --lib — 2244 passed, 1 ignored
  • cargo test -p paimon-datafusion --test pk_tables — 54 passed
  • cargo clippy -p paimon --all-targets -- -D warnings
  • cargo clippy -p paimon-datafusion --test pk_tables -- -D warnings
  • cargo fmt --all -- --check
  • git diff --check

@JingsongLi
JingsongLi marked this pull request as ready for review August 12, 2026 10:58

@leaves12138 leaves12138 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed the deletion-vector merge-on-read implementation in detail. The scan planning, per-file deletion-vector application before key merging, post-merge residual filtering, incremental-read isolation, and bounded merge fan-in all look correct. Targeted core and DataFusion tests pass, formatting is clean, and all CI checks are green. LGTM.

@JingsongLi
JingsongLi merged commit f9f279d into apache:main Aug 12, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants