github-actions[bot] commented on code in PR #64366:
URL: https://github.com/apache/doris/pull/64366#discussion_r3393114226


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FoldConstantRuleOnFE.java:
##########
@@ -554,6 +556,12 @@ public Expression visitBoundFunction(BoundFunction 
boundFunction, ExpressionRewr
         if (checkedExpr.isPresent()) {
             return checkedExpr.get();
         }
+        if (boundFunction instanceof Now) {

Review Comment:
   This direct cast regresses existing `now(null)` handling. After 
`rewriteChildren` and `preProcess`, a `Now` with a `NullLiteral` precision is 
still foldable because `Now` is not a `PropagateNullable` function and all 
arguments are literals, so this line throws `ClassCastException` during normal 
expression normalization. There is existing regression coverage for `select 
now(null)` in 
`regression-test/suites/query_p0/sql_functions/datetime_functions/test_date_function.groovy`;
 before this change the executable-function lookup did not match 
`now(IntegerLiteral)` and left the expression for normal execution. Please 
preserve that "cannot fold" behavior for non-`IntegerLiteral` precision values, 
or handle nullable/integer-like literals explicitly before reading the 
precision.



-- 
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