dwdwqfwe commented on code in PR #54972:
URL: https://github.com/apache/doris/pull/54972#discussion_r2286789149


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Mask.java:
##########
@@ -57,17 +72,12 @@ private Mask(ScalarFunctionParams functionParams) {
      */
     @Override
     public Mask withChildren(List<Expression> children) {
-        Preconditions.checkArgument(!children.isEmpty());
+        Preconditions.checkArgument(!children.isEmpty()
+                && arity() >= 1
+                && arity() <= 4);
         return new Mask(getFunctionParams(children));
     }
 
-    @Override
-    public void checkLegalityAfterRewrite() {
-        if (arity() > 4) {
-            throw new IllegalArgumentException("mask function only supports 1 
to 4 arguments, but got: " + arity());
-        }
-    }
-

Review Comment:
   Beacaue int debug_skip_fold_constant = false,enable_fold_constant = true,the 
be function will execute before rewrite done,so it will check after be function 
execute



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