diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayIntersect.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayIntersect.java index 0811304e51..fdda79a35b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayIntersect.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayIntersect.java @@ -21,10 +21,10 @@ import org.apache.doris.catalog.FunctionSignature; 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.BinaryExpression; import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor; import org.apache.doris.nereids.types.ArrayType; import org.apache.doris.nereids.types.coercion.AnyDataType; +import org.apache.doris.nereids.util.ExpressionUtils; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; @@ -34,19 +34,18 @@ import java.util.List; /** * ScalarFunction 'array_intersect'. This class is generated by GenerateFunction. */ -public class ArrayIntersect extends ScalarFunction implements ExplicitlyCastableSignature, - BinaryExpression, PropagateNullable { +public class ArrayIntersect extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullable { public static final List SIGNATURES = ImmutableList.of( FunctionSignature.retArgType(0) - .args(ArrayType.of(new AnyDataType(0)), ArrayType.of(new AnyDataType(0))) + .varArgs(ArrayType.of(new AnyDataType(0)), ArrayType.of(new AnyDataType(0))) ); /** - * constructor with 2 arguments. + * constructor with 2 or more arguments. */ - public ArrayIntersect(Expression arg0, Expression arg1) { - super("array_intersect", arg0, arg1); + public ArrayIntersect(Expression arg0, Expression arg1, Expression... varArgs) { + super("array_intersect", ExpressionUtils.mergeArguments(arg0, arg1, varArgs)); } /** @@ -54,8 +53,9 @@ public class ArrayIntersect extends ScalarFunction implements ExplicitlyCastable */ @Override public ArrayIntersect withChildren(List children) { - Preconditions.checkArgument(children.size() == 2); - return new ArrayIntersect(children.get(0), children.get(1)); + Preconditions.checkArgument(children.size() >= 2); + return new ArrayIntersect(children.get(0), children.get(1), + children.subList(2, children.size()).toArray(new Expression[0])); } @Override