Repository navigation
fix(merge_insert): plan small streaming sources with exact statistics - #11733
Merged
BubbleCal merged 3 commits intoDec 2, 2026
Merged
Conversation
BubbleCal
marked this pull request as ready for review
December 2, 2026 10:08
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The bounded statistics approach addresses #9505 for small sources that finish within the probe limits. Local probe, join-selection, retry, and multi-fragment partial-update checks passed.
Xuanwo
approved these changes
Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #9505. A non-indexed merge with a small streaming source and no statistics can build the hash table from the entire target. When an eligible Lance-owned stream reaches EOF within a bounded probe, pass exact source statistics to DataFusion through a MemTable. When the probe stops early, deliver its buffered batches and the rest of the stream in order.
Keep the existing join actions and retry policy. An authorized retry can reuse the prepared source and plan again against the refreshed target.
Performance
The V1 run compared
00122ee030f1e385c8848adc1f7924f7dfd3baa9with3d3f5bfa6217487a49b308cbb322d7f48d94f379. The 10M-row, 44-column fixture includes a deletion vector and an uncovered tail. Each run applies 100 one-shot updates with RewriteRows. Runs used a GCP n2-highmem-16 VM, attached 350 GB GCPpd-ssd, 8 CPUs and an 88 GiB cgroup limit. Medians use two AB/BA repetitions per arm and cache condition. The hot condition pre-reads the snapshot into the OS page cache. V1 latency is measured from arrival to commit acknowledgement.All eight V1 cells matched the independently regenerated plan, passed the full-table oracle and recorded zero OOM kills. Peak cgroup charge includes charged file cache.
The cold fallback controls use the same frozen snapshot and settings, with two AB/BA repetitions per arm. The delayed reader waits 150 ms before batch two. The over-limit reader delivers 50 batches of two rows. These latencies measure public execution through commit return. All eight operations passed the full-table oracle.
Validation
00122ee03. The managed VM also passed all 11 source-statistics tests and the build-side plan test, including the zero-poll invalid UpdateIf and successful retry after a 34-batch fallback.