Skip to content

use entire lateral scope when indexing RangeHeapJoin#2205

Merged
jycor merged 3 commits intomainfrom
james/range
Dec 19, 2023
Merged

use entire lateral scope when indexing RangeHeapJoin#2205
jycor merged 3 commits intomainfrom
james/range

Conversation

@jycor
Copy link
Copy Markdown
Contributor

@jycor jycor commented Dec 15, 2023

RangeHeapJoins looked at the lateral join scope when assigning indexes.
However, we never tested nested joins for this case, leading to dolthub/dolt#7177

What made the error more apparent was the string in the left scope that would result in empty results when doing lookups into the right tables. The fix was to look at the whole lateral scope when indexing RangeHeapJoins

fixes dolthub/dolt#7177

Copy link
Copy Markdown
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

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

lgtm, if i'm reading correctly we just were just failing to shift the indexes for index nodes? so does this fix the same issue for range joins inside subquery expressions that have outer scope access?

@jycor
Copy link
Copy Markdown
Contributor Author

jycor commented Dec 18, 2023

I think we have tests in join_planning_tests.go with this behavior, but it doesn't seem like those joins are impacted by this fix.

@jycor jycor merged commit dc8fae3 into main Dec 19, 2023
@jycor jycor deleted the james/range branch December 19, 2023 02:22
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.

Query results are not as expected

2 participants