daju233 commented on code in PR #60192:
URL: https://github.com/apache/doris/pull/60192#discussion_r2899315163
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayCombinations.java:
##########
@@ -18,58 +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.AlwaysNullable;
import
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
-import
org.apache.doris.nereids.trees.expressions.functions.PropagateNullLiteral;
-import org.apache.doris.nereids.trees.expressions.shape.BinaryExpression;
+import org.apache.doris.nereids.trees.expressions.functions.PropagateNullable;
+import org.apache.doris.nereids.trees.expressions.literal.IntegerLikeLiteral;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DoubleType;
-import org.apache.doris.nereids.types.VarcharType;
+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;
/**
- * ScalarFunction 'st_distance'.
+ * ScalarFunction 'combinations'
*/
-public class StDistance extends ScalarFunction
- implements BinaryExpression, ExplicitlyCastableSignature,
AlwaysNullable, PropagateNullLiteral {
+public class ArrayCombinations extends ScalarFunction
+ implements ExplicitlyCastableSignature, PropagateNullable {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
-
FunctionSignature.ret(DoubleType.INSTANCE).args(VarcharType.SYSTEM_DEFAULT,
VarcharType.SYSTEM_DEFAULT)
- );
+ FunctionSignature.ret(ArrayType.of(ArrayType.of(new
FollowToAnyDataType(0))))
+ .args(ArrayType.of(new AnyDataType(0)),
BigIntType.INSTANCE));
/**
* constructor with 2 arguments.
*/
- public StDistance(Expression arg0, Expression arg1) {
- super("st_distance", arg0, arg1);
+ public ArrayCombinations(Expression arg0, Expression arg1) {
+ super("array_combinations", arg0, arg1);
}
- /** constructor for withChildren and reuse signature */
- private StDistance(ScalarFunctionParams functionParams) {
- super(functionParams);
+ @Override
+ public void checkLegalityBeforeTypeCoercion() {
+ if (!(child(1) instanceof IntegerLikeLiteral)) {
Review Comment:
Identify from the frontend and then return an empty column directly from
backend?
--
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]