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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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.

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.

2 participants