superdiaodiao commented on code in PR #34391:
URL: https://github.com/apache/doris/pull/34391#discussion_r1590292952


##########
be/src/vec/functions/round.h:
##########
@@ -696,49 +679,236 @@ class FunctionRounding : public IFunction {
         return Status::OK();
     }
 
-    ColumnNumbers get_arguments_that_are_always_constant() const override { 
return {1}; }
+    ColumnNumbers get_arguments_that_are_always_constant() const override { 
return {}; }
+    // SELECT number, func(123.345, 1) FROM numbers("number"="10")
+    // should NOT behave like two column arguments, so we can not use const 
column default implementation
+    bool use_default_implementation_for_constants() const override { return 
false; }

Review Comment:
   This part tries to keep the same with truncate's behavior from 
[PR#32746.](https://github.com/apache/doris/pull/32746) Specifically, it said 
that:
   > Function truncate can use column as its scale argument. The precision 
infer rule of truncate is same with mysql:
   > 
   > When using literal as scale, result scale is dependent on the integer 
literal;
   > When using column as scale, result will always have same scale with input 
decimal.
   



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to