[CALCITE-5483] ProjectAggregateMergeRule throws exception if literal is non-numeric#3038
Closed
libenchao wants to merge 3 commits intoapache:mainfrom
Closed
Conversation
| == SqlKind.INPUT_REF | ||
| && operands.get(2).getKind() == SqlKind.LITERAL) { | ||
| && operands.get(2).getKind() == SqlKind.LITERAL | ||
| && operands.get(2).getType().getFamily() == SqlTypeFamily.NUMERIC) { |
Contributor
There was a problem hiding this comment.
Optionally, you could move this test (operands.get(2).getType().getFamily() == SqlTypeFamily.NUMERIC) to just before the call to literal.getValueAs(BigDecimal.class) - it might have better context.
Member
Author
There was a problem hiding this comment.
I was meant to remove this check originally since we can assume the operand is numeric when the aggregator is SUM. Sorry that this was still in my git staging.
|
Kudos, SonarCloud Quality Gate passed! |
Member
Author
|
@birschick-bq Thanks for your review. I'll merge this after '1.33.0' is out if there is no more objections anymore. And I'll add @birschick-bq as the co-author since this PR is mostly based on his #3031. |
gleonSun
pushed a commit
to gleonSun/calcite
that referenced
this pull request
Dec 20, 2023
…is non-numeric Close apache#3038 Co-authored-by: Bruce Irschick <brucei@bitquilltech.com>
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.








This PR is based on #3031 from @birschick-bq