Repository navigation
fix(merge_insert): project unindexed fragments to the source's nested subset - #11314
Merged
wjones127 merged 1 commit intoNov 23, 2026
Conversation
deeps1991
marked this pull request as ready for review
November 20, 2026 13:50
deeps1991
marked this pull request as draft
November 20, 2026 13:50
wjones127
approved these changes
Nov 20, 2026
wjones127
left a comment
Contributor
There was a problem hiding this comment.
Thanks, this is a clean fix. Reusing the take's Projection for the fallback scan means the two sides of the UnionExec can't drift apart.
One optional suggestion on the new test's update_if condition.
… subset
An indexed merge_insert unions the indexed take with a scan of the
fragments the index does not cover (and of overlay-stale rows). The take
projects the target through a Lance `Projection` built from the source
schema, so a source whose `cells` carries only some of a struct's
children narrows `cells` to those children. The fallback scan projected
by top-level column names instead, which reads the full nested type.
`UnionExec` then rejected the mismatched types ("requires all inputs to
have the same data type per column"); on older DataFusion versions this
was a panic.
Project the fallback scan with the same projection's schema so both
inputs emit identical types.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
deeps1991
force-pushed
the
deepthisrinivasan/oss-2651-indexed-merge-insert-nested-subset
branch
from
November 23, 2026 16:56
d3c8660 to
2837cc9
Compare
deeps1991
marked this pull request as ready for review
November 23, 2026 17:45
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
An indexed
merge_insertwhose source carries a subset of a nestedstruct's children failed when the table also had fragments the index
does not cover. The indexed take narrowed the struct to the source's
children, but the scan of unindexed fragments read the full struct, so
the
UnionExeccombining them rejected the mismatched types (a panic onDataFusion 54, a plan error on 55).
The fallback scan now uses the same projection as the take.
Tests
test_indexed_partial_update_if_nested_subset_unindexed_fragment: atable with
cells: list<struct<idx, timestamp, data>>, an index overone fragment and an appended unindexed fragment, and a source supplying
only
idxanddata. It checks that both keys are updated, that theunsupplied
timestampchild is preserved, and that theupdate_ifcondition evaluates on the row from the unindexed scan. The test fails
without the fix with the
UnionExecerror.🤖 Generated with Claude Code