daju233 commented on code in PR #60192:
URL: https://github.com/apache/doris/pull/60192#discussion_r2786328152


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayCombinations.java:
##########
@@ -18,52 +18,67 @@
 package org.apache.doris.nereids.trees.expressions.functions.scalar;
 
 import org.apache.doris.catalog.FunctionSignature;
+import org.apache.doris.nereids.exceptions.AnalysisException;
 import org.apache.doris.nereids.trees.expressions.Expression;
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import org.apache.doris.nereids.trees.expressions.functions.PropagateNullable;
-import org.apache.doris.nereids.trees.expressions.shape.UnaryExpression;
+import org.apache.doris.nereids.trees.expressions.literal.IntegerLikeLiteral;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.QuantileStateType;
-import org.apache.doris.nereids.types.StringType;
+import org.apache.doris.nereids.types.ArrayType;
+import org.apache.doris.nereids.types.BigIntType;
+import org.apache.doris.nereids.types.coercion.AnyDataType;
+import org.apache.doris.nereids.types.coercion.FollowToAnyDataType;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 
 import java.util.List;
 
 /**
- * Function 'quantile_state_to_base64'.
+ * ScalarFunction 'combinations'
  */
-public class QuantileStateToBase64 extends ScalarFunction
-        implements UnaryExpression, ExplicitlyCastableSignature, 
PropagateNullable {
+public class ArrayCombinations extends ScalarFunction
+        implements ExplicitlyCastableSignature, PropagateNullable {
 
     public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
-            
FunctionSignature.ret(StringType.INSTANCE).args(QuantileStateType.INSTANCE)
-    );
+            FunctionSignature.ret(ArrayType.of(ArrayType.of(new 
FollowToAnyDataType(0))))
+                    .args(ArrayType.of(new AnyDataType(0)), 
BigIntType.INSTANCE));
 
     /**
-     * constructor with 1 argument.
+     * constructor with 2 arguments.
      */
-    public QuantileStateToBase64(Expression arg) {
-        super("quantile_state_to_base64", arg);
+    public ArrayCombinations(Expression arg0, Expression arg1) {
+        super("array_combinations", arg0, arg1);
+    }
+
+    @Override
+    public void checkLegalityBeforeTypeCoercion() {
+        if (!(child(1) instanceof IntegerLikeLiteral)) {
+            throw new AnalysisException("Array_Combinations's second argument 
must be a constant literal.");
+        }
     }
 
-    /**
-     * withChildren.
-     */
     @Override
-    public QuantileStateToBase64 withChildren(List<Expression> children) {
-        Preconditions.checkArgument(children.size() == 1);
-        return new QuantileStateToBase64(children.get(0));
+    public void checkLegalityAfterRewrite() {
+        super.checkLegalityBeforeTypeCoercion();

Review Comment:
   it's a mistake,I will fix it.



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