-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](Nereids) ComputePrecisionForRound should only process integral literal #34473
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,8 @@ default FunctionSignature computePrecision(FunctionSignature signature) { | |
| Expression floatLength = getArgument(1); | ||
| int scale; | ||
|
|
||
| if (floatLength.isLiteral() || (floatLength instanceof Cast && floatLength.child(0).isLiteral() | ||
| if ((floatLength.isLiteral() && floatLength.getDataType() instanceof Int32OrLessType) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in what situation would scale does not have integer type?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when we do computePrecision, we do not finish compute signature. so type coercion do not apply. so its child could be any type literal |
||
| || (floatLength instanceof Cast && floatLength.child(0).isLiteral() | ||
| && floatLength.child(0).getDataType() instanceof Int32OrLessType)) { | ||
| // Scale argument is a literal or cast from other literal | ||
| if (floatLength instanceof Cast) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the relation between this for loop with round function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is another bug, and have no relation with round function