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-6834] In query that applies COALESCE to nullable SUM, Enumer… #4201

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

NobiGo
Copy link
Contributor

@NobiGo NobiGo commented Feb 17, 2025

…ableProjectToCalcRule throws AssertionError

for (RexNode rexInputRef : rexInputRefs) {
selectList.add(rexInputRef.accept(rexShuttle));
}
builder.project(selectList.build());
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can achieve the same effect with one line of code: use RelBuilder.cast to convert the output row type of aggregate to what project expects it to be. If cast adds a CAST call then project will flatten the expression on top of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What you are referring to here should be RelBuilder.convert, which also requires us to build a new RowType based on Mapping, so I have not made any changes here.

Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

@NobiGo
Copy link
Contributor Author

NobiGo commented Mar 24, 2025

@julianhyde @mihaibudiu Could you please review this PR? Then we can move forward with it.

…bleProjectToCalcRule throws AssertionError
@NobiGo NobiGo merged commit 254f2ba into apache:main Mar 27, 2025
17 of 18 checks passed
@NobiGo NobiGo deleted the CALCITE-6834 branch March 27, 2025 04:41
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.

None yet

3 participants