morrySnow commented on code in PR #52447:
URL: https://github.com/apache/doris/pull/52447#discussion_r2199662687


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ComputePrecisionForRound.java:
##########
@@ -37,6 +40,12 @@ default FunctionSignature computePrecision(FunctionSignature 
signature) {
             Expression floatLength = getArgument(1);
             int scale;
 
+            if (!floatLength.isLiteral() && !floatLength.isSlot()) {
+                ExpressionRewriteContext rewriteContext = new 
ExpressionRewriteContext(
+                        CascadesContext.initTempContext());
+                floatLength = FoldConstantRuleOnFE.evaluate(floatLength, 
rewriteContext);

Review Comment:
   this could not resolve all issues, think about a function `round(x + 1)`, 
after constant propagation, x replaced by literal 1, and then the signature may 
be changed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to