Skip to content

First pass at correlated subqueries#6100

Merged
mattnibs merged 1 commit intomainfrom
correlated-subquery
Aug 11, 2025
Merged

First pass at correlated subqueries#6100
mattnibs merged 1 commit intomainfrom
correlated-subquery

Conversation

@mattnibs
Copy link
Collaborator

@mattnibs mattnibs commented Aug 5, 2025

This commit allow use of correlated subqueries for pipe syntax. Correlated subqueries using the outer scope for SQL queries remains unsupported.

Fixes #6013
Fixes #6058

@mattnibs mattnibs requested a review from a team August 5, 2025 21:46
@mattnibs mattnibs force-pushed the correlated-subquery branch from 6e94bcb to b5e733e Compare August 5, 2025 21:47
Copy link
Member

Choose a reason for hiding this comment

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

The need for double parentheses here is a bringdown. Did you already burn time looking for a way to avoid it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was what @mccanne did with the parsing logic. I suppose we could add back the Expr / UnnestExpr to function calls and just change it to Expr / QueryExpr, but I'd like to hear from @mccanne

@mattnibs mattnibs force-pushed the correlated-subquery branch 2 times, most recently from 8ce5c18 to 74d6eb9 Compare August 6, 2025 17:43
@mattnibs mattnibs requested review from mccanne and nwt August 6, 2025 17:43
@mattnibs mattnibs force-pushed the correlated-subquery branch from 74d6eb9 to bf13042 Compare August 6, 2025 17:46
@mattnibs mattnibs force-pushed the correlated-subquery branch 2 times, most recently from c2a9a32 to a5a6f1e Compare August 11, 2025 17:34
This commit allow use of correlated subqueries for pipe syntax.
Correlated subqueries using the outer scope for SQL queries remains
unsupported.
@mattnibs mattnibs force-pushed the correlated-subquery branch from a5a6f1e to c9ea127 Compare August 11, 2025 17:38
@mattnibs mattnibs merged commit 05868c7 into main Aug 11, 2025
5 checks passed
@mattnibs mattnibs deleted the correlated-subquery branch August 11, 2025 17:43
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.

Unnesting a subquery SQL: Subqueries

3 participants