Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: join order rewrite rule #2295

Merged
merged 4 commits into from
Feb 21, 2025
Merged

fix: join order rewrite rule #2295

merged 4 commits into from
Feb 21, 2025

Conversation

joshua-spacetime
Copy link
Collaborator

@joshua-spacetime joshua-spacetime commented Feb 21, 2025

Description of Changes

After swapping the left and right hand sides of a delta join, we were not updating the left and right hand side join fields.

This resulted in a stack overflow when applying a different rewrite rule for translating named arguments into positional ones.

As part of this patch I also modified the rewrite that stack overflowed to error if an invariant is not met.

API and ABI breaking changes

None

Expected complexity level and risk

1

Testing

Added basic regression test that stack overflowed before this change.

Added an incremental evaluation test similar to the ones we currently have. The current tests we have did not exercise this particular rewrite (left vs right join), and so did not catch this bug.

@joshua-spacetime joshua-spacetime added bugfix Fixes something that was expected to work differently release-1.0 labels Feb 21, 2025
Copy link
Contributor

@mamcx mamcx left a comment

Choose a reason for hiding this comment

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

LGTM

After swapping the left and right hand sides of a delta join,
we were not updating the left and right hand side join fields.
@joshua-spacetime joshua-spacetime linked an issue Feb 21, 2025 that may be closed by this pull request
@joshua-spacetime joshua-spacetime added this pull request to the merge queue Feb 21, 2025
Merged via the queue into master with commit 97de450 Feb 21, 2025
15 checks passed
@joshua-spacetime joshua-spacetime deleted the joshua/fix/planner branch February 21, 2025 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes something that was expected to work differently release-1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack overflow in query planner for incremental joins
3 participants