Repository navigation
[CALCITE-7933] Correlated subqueries with lambdas that capture columns are incorrectly compiled - #5409
Open
mihaibudiu wants to merge 1 commit into
Open
[CALCITE-7933] Correlated subqueries with lambdas that capture columns are incorrectly compiled#5409mihaibudiu wants to merge 1 commit into
mihaibudiu wants to merge 1 commit into
Conversation
…s are incorrectly compiled This commit contains multiple small changes and fixes related to lambdas: SqlToRelConverter: - Allow a lambda in a sub-query to read a column of the enclosing query. - A lambda in an aggregate gave wrong results or an out-of-bounds error; now it should work correctly. CorrelateProjectExtractor: - does not move an expression that reads a parameter out of the lambda. EnumUtils: - In the generated Java code the parameters of the generated code are final. Before, Janino rejected the generated code. Validator: - Reject lambda which have subquries in the body. This is in line with all major SQL dialects which support lambdas. - Reject lambdas which invoke an aggregate function, GROUPING, or a windowed aggregate. - Reject a lambda in the ORDER BY clause which attempts to read columns (this used to crash; support can be added later if desired) - SqlLambdaScope.isParameter checks the first name of a compound identifier, such as r.f0. Before, it failed with an AssertionError. Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
mihaibudiu
force-pushed
the
issue7933
branch
from
November 12, 2026 01:35
65f52a3 to
e40203f
Compare
Contributor
Author
|
I have validated all quidem queries with DuckDB and Spark (Spark rejects two queries) |
2 tasks done
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.
Jira Link
CALCITE-7933
Changes Proposed
This commit contains multiple small changes and fixes related to lambdas:
SqlToRelConverter:
CorrelateProjectExtractor:
EnumUtils:
Validator: