Skip to content

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

Draft
XiaoHongbo-Hope wants to merge 5 commits into
apache:masterfrom
XiaoHongbo-Hope:defer_blob_resolve
Draft

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

Conversation

@XiaoHongbo-Hope

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. read.defer-blob-resolve=false restores the previous behavior.

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

…LOB reads

Row-level authorization filters were not accounted for in three blob paths:
- Keep the auth filter outermost (after inline BLOB resolution) when it references
  an inline blob-descriptor/blob-view field, so it compares the resolved payload,
  not descriptor/BlobViewStruct bytes (was a row-level auth bypass).
- Skip pushing LIMIT down to the BlobView prescan reader when an auth filter is
  present, so the prescan row set matches the outer auth-filtered set (was raising
  "row id ... was not found in upstream table").
- Enable deferred BLOB resolution when only an auth filter is present (no user
  predicate/limit), so payloads of auth-dropped rows are not read.

Add a regression test for the last case.
… inline BLOB

When the auth filter referenced an inline (descriptor/view) BLOB, the previous
fix ran it outermost, which disabled deferral for all other scalar BLOBs so
their payloads were read for auth-dropped rows too.

Instead run the auth filter (and LIMIT) inside the split read, after inline BLOB
resolution but before deferred scalar resolution: inline resolve -> auth/limit ->
deferred scalar resolve. So it still compares resolved inline payloads while
non-auth scalar BLOBs are deferred past it.
@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
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.

1 participant