Skip to content

[python] Defer BLOB payload reads until after filtering - #8808

Open
XiaoHongbo-Hope wants to merge 3 commits into
apache:masterfrom
XiaoHongbo-Hope:defer_blob_resolve
Open

[python] Defer BLOB payload reads until after filtering#8808
XiaoHongbo-Hope wants to merge 3 commits into
apache:masterfrom
XiaoHongbo-Hope:defer_blob_resolve

Conversation

@XiaoHongbo-Hope

@XiaoHongbo-Hope XiaoHongbo-Hope commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Purpose

Filtered data-evolution scans previously materialized projected BLOB payloads before applying residual filters and limits. This made filtered-out rows still incur payload I/O.

Read eligible BLOB fields as descriptors through merge, filter and limit, then materialize only surviving rows. Predicates referencing the BLOB field keep the eager path.

Tests

  • deferred_blob_resolve_test.py
  • data_evolution_deletion_vector_test.py
  • test_limit_pushdown.py
  • DedicatedFormatWriterTest#test_update_blob_column
  • DedicatedFormatWriterTest#test_array_blob_column_write_read_and_update
  • DedicatedFormatWriterTest#test_map_blob_column_write_read_and_update

@XiaoHongbo-Hope
XiaoHongbo-Hope marked this pull request as ready for review July 23, 2026 14:24
@XiaoHongbo-Hope
XiaoHongbo-Hope marked this pull request as draft July 23, 2026 14:27
@XiaoHongbo-Hope
XiaoHongbo-Hope force-pushed the defer_blob_resolve branch 2 times, most recently from 00da6b2 to 1a46c7e Compare August 1, 2026 03:54

Copilot AI 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.

🟡 Not ready to approve

The newly introduced use of AuthFilterReader in the data-evolution chain can drop file_io metadata (since AuthFilterReader doesn’t adopt it), which can break descriptor-mode blob access and should be fixed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR improves PyPaimon data-evolution read efficiency by deferring scalar BLOB payload materialization until after row selection (filters/auth filters/limits), so filtered-out rows do not incur payload I/O; it also adds an option to restore eager behavior.

Changes:

  • Add a deferred BLOB materialization stage for data-evolution reads and integrate it into the split-read pipeline.
  • Adjust limit handling and parallel read decisions to avoid materializing BLOB payloads from splits that would be discarded by LIMIT.
  • Add read.defer-blob-resolve option, documentation, and new tests validating deferred/eager behavior across predicates, limits, auth filters, and null payloads.
File summaries
File Description
paimon-python/pypaimon/tests/deferred_blob_resolve_test.py New tests asserting deferred BLOB reads with predicate/limit/auth filters and verifying eager fallback cases.
paimon-python/pypaimon/read/table_read.py Wires remaining-limit per split, adds parallelism gating when deferred BLOB + LIMIT may prune, and passes auth-filter information into split reads.
paimon-python/pypaimon/read/split_read.py Computes deferred BLOB field set, reads deferred scalar BLOBs as descriptors, applies post-merge auth filtering, and adds DeferredBlobResolveReader.
paimon-python/pypaimon/read/reader/deferred_blob_resolve_reader.py New reader that materializes deferred BLOB payloads into Arrow batches after row selection.
paimon-python/pypaimon/common/options/core_options.py Adds read.defer-blob-resolve option and accessor.
docs/docs/pypaimon/blob.md Documents deferred materialization behavior and the opt-out configuration.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 3
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread paimon-python/pypaimon/read/reader/deferred_blob_resolve_reader.py Outdated
Comment thread paimon-python/pypaimon/read/split_read.py
Comment thread paimon-python/pypaimon/read/split_read.py

Copilot AI 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.

🟡 Human review recommended

It changes core read-path semantics (filter/limit/auth interactions plus concurrency behavior) and warrants final human validation despite strong test additions.

Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@JingsongLi

Copy link
Copy Markdown
Contributor

Why need read.defer-blob-resolve=false to restore the previous behavior?

@XiaoHongbo-Hope

Copy link
Copy Markdown
Contributor Author

Why need read.defer-blob-resolve=false to restore the previous behavior?

Removed

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.

3 participants