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

[CALCITE-6554] Check for correlation variables in project during SqlToRelConverter.createAggImpl #3938

Conversation

ian-bertolacci
Copy link

Check for correlation variables in intermediate project when converting aggregation.

Its probably wise for us to check other places where this may be an issue.

I'm open to alternative solutions which have a wider effect, such as having the RelBuilder or even the constructor collect the correlation variables when the variable set is otherwise undefined.

Copy link
Contributor

@mihaibudiu mihaibudiu left a comment

Choose a reason for hiding this comment

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

I am not familiar with the builder, so I cannot make a confident statement, but the tests seem fine.

@mihaibudiu mihaibudiu added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Aug 30, 2024
@@ -668,6 +668,53 @@ FROM (SELECT 1 AS a) AS t;

!ok

# [CALCITE-6554] Nested correlated subqueries
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be the same as the Jira Summary.

@@ -3770,6 +3770,34 @@ void checkCorrelatedMapSubQuery(boolean expand) {
sql(sql).withExpand(false).withDecorrelate(false).ok();
}

@Test void testCorrelationInProjectionWith1xNestedCorrelatedProjection() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the first test case can add the Jira link and description.

@mihaibudiu
Copy link
Contributor

@ian-bertolacci, can you please address the comments from @NobiGo?
Then we can probably merge this

@caicancai
Copy link
Member

@ian-bertolacci Please squash commit so that this PR can be merged

@ian-bertolacci ian-bertolacci force-pushed the CALCITE-65540-SqlToRelConverter-nested-correlated-sub-query-createAggImpl branch from 64348b2 to 5b728ce Compare September 17, 2024 21:23
@ian-bertolacci
Copy link
Author

I've gone ahead and done it, but I'm pretty sure Github has squash-and-merge functionality, which would be nice if we could use.
I personally hate manually altering git history, and doing a squash on merge means you're not waiting on me (or anyone else in the future) to do it.

Copy link

@mihaibudiu mihaibudiu merged commit 7481b85 into apache:main Sep 18, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LGTM-will-merge-soon Overall PR looks OK. Only minor things left.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants