zclllyybb commented on code in PR #28076:
URL: https://github.com/apache/doris/pull/28076#discussion_r1417183097


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Random.java:
##########
@@ -80,13 +92,15 @@ public boolean foldable() {
      */
     @Override
     public Random withChildren(List<Expression> children) {
-        Preconditions.checkArgument(children.size() == 0
-                || children.size() == 1);
-        if (children.isEmpty() && arity() == 0) {
-            return this;
-        } else {
+        if (children.isEmpty()) {
+            return new Random();
+        } else if (children.size() == 1) {
             return new Random(children.get(0));
+        } else if (children.size() == 2) {
+            return new Random(children.get(0), children.get(1));
         }
+        Preconditions.checkArgument(false, "random function only accept 0-2 
arguments");

Review Comment:
   fixed



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