diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ComputePrecisionForRound.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ComputePrecisionForRound.java index 36abfe5a06..4b57772ed2 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ComputePrecisionForRound.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ComputePrecisionForRound.java @@ -20,7 +20,7 @@ package org.apache.doris.nereids.trees.expressions.functions; import org.apache.doris.catalog.FunctionSignature; import org.apache.doris.nereids.trees.expressions.Cast; import org.apache.doris.nereids.trees.expressions.Expression; -import org.apache.doris.nereids.trees.expressions.literal.IntegerLiteral; +import org.apache.doris.nereids.trees.expressions.literal.IntegerLikeLiteral; import org.apache.doris.nereids.types.DecimalV3Type; import org.apache.doris.nereids.types.coercion.Int32OrLessType; @@ -34,7 +34,7 @@ public interface ComputePrecisionForRound extends ComputePrecision { DecimalV3Type decimalV3Type = DecimalV3Type.forType(getArgumentType(0)); return signature.withArgumentType(0, decimalV3Type) .withReturnType(DecimalV3Type.createDecimalV3Type(decimalV3Type.getPrecision(), 0)); - } else if (arity() == 2 && getArgumentType(0).isDecimalV3Type()) { + } else if (arity() == 2 && signature.getArgType(0) instanceof DecimalV3Type) { DecimalV3Type decimalV3Type = DecimalV3Type.forType(getArgumentType(0)); Expression floatLength = getArgument(1); Preconditions.checkArgument(floatLength.getDataType() instanceof Int32OrLessType @@ -45,10 +45,11 @@ public interface ComputePrecisionForRound extends ComputePrecision { int scale; if (floatLength instanceof Cast) { - scale = ((IntegerLiteral) floatLength.child(0)).getIntValue(); + scale = ((IntegerLikeLiteral) floatLength.child(0)).getIntValue(); } else { - scale = ((IntegerLiteral) floatLength).getIntValue(); + scale = ((IntegerLikeLiteral) floatLength).getIntValue(); } + scale = Math.min(Math.max(scale, 0), decimalV3Type.getScale()); return signature.withArgumentType(0, decimalV3Type) .withReturnType(DecimalV3Type.createDecimalV3Type(decimalV3Type.getPrecision(), scale)); } else { diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Ceil.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Ceil.java index 7359aa2ca4..0e388c5db3 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Ceil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Ceil.java @@ -24,7 +24,9 @@ import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSi 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.visitor.ExpressionVisitor; +import org.apache.doris.nereids.types.DecimalV3Type; import org.apache.doris.nereids.types.DoubleType; +import org.apache.doris.nereids.types.IntegerType; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; @@ -38,7 +40,9 @@ public class Ceil extends ScalarFunction implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullable, ComputePrecisionForRound { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE) + FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD, IntegerType.INSTANCE) ); /** @@ -48,13 +52,24 @@ public class Ceil extends ScalarFunction super("ceil", arg); } + /** + * constructor with 2 argument. + */ + public Ceil(Expression arg0, Expression arg1) { + super("ceil", arg0, arg1); + } + /** * withChildren. */ @Override public Ceil withChildren(List children) { - Preconditions.checkArgument(children.size() == 1); - return new Ceil(children.get(0)); + Preconditions.checkArgument(children.size() == 1 || children.size() == 2); + if (children.size() == 1) { + return new Ceil(children.get(0)); + } else { + return new Ceil(children.get(0), children.get(1)); + } } @Override diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Dceil.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Dceil.java index 7f08eef4cf..bb0f6f0216 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Dceil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Dceil.java @@ -24,7 +24,9 @@ import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSi 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.visitor.ExpressionVisitor; +import org.apache.doris.nereids.types.DecimalV3Type; import org.apache.doris.nereids.types.DoubleType; +import org.apache.doris.nereids.types.IntegerType; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; @@ -38,7 +40,9 @@ public class Dceil extends ScalarFunction implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullable, ComputePrecisionForRound { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE) + FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD, IntegerType.INSTANCE) ); /** @@ -48,13 +52,24 @@ public class Dceil extends ScalarFunction super("dceil", arg); } + /** + * constructor with 2 arguments. + */ + public Dceil(Expression arg0, Expression arg1) { + super("dceil", arg0, arg1); + } + /** * withChildren. */ @Override public Dceil withChildren(List children) { - Preconditions.checkArgument(children.size() == 1); - return new Dceil(children.get(0)); + Preconditions.checkArgument(children.size() == 1 || children.size() == 2); + if (children.size() == 1) { + return new Dceil(children.get(0)); + } else { + return new Dceil(children.get(0), children.get(1)); + } } @Override diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Dfloor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Dfloor.java index 10260662ee..ec2039e121 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Dfloor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Dfloor.java @@ -24,7 +24,9 @@ import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSi 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.visitor.ExpressionVisitor; +import org.apache.doris.nereids.types.DecimalV3Type; import org.apache.doris.nereids.types.DoubleType; +import org.apache.doris.nereids.types.IntegerType; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; @@ -38,8 +40,9 @@ public class Dfloor extends ScalarFunction implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullable, ComputePrecisionForRound { public static final List SIGNATURES = ImmutableList.of( - // TODO: decimal - FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE) + FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD, IntegerType.INSTANCE) ); /** @@ -49,13 +52,24 @@ public class Dfloor extends ScalarFunction super("dfloor", arg); } + /** + * constructor with 2 argument. + */ + public Dfloor(Expression arg0, Expression arg1) { + super("dfloor", arg0, arg1); + } + /** * withChildren. */ @Override public Dfloor withChildren(List children) { - Preconditions.checkArgument(children.size() == 1); - return new Dfloor(children.get(0)); + Preconditions.checkArgument(children.size() == 1 || children.size() == 2); + if (children.size() == 1) { + return new Dfloor(children.get(0)); + } else { + return new Dfloor(children.get(0), children.get(1)); + } } @Override diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Dround.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Dround.java index a4b3604abe..bb2502e8c9 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Dround.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Dround.java @@ -23,6 +23,7 @@ import org.apache.doris.nereids.trees.expressions.functions.ComputePrecisionForR 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.visitor.ExpressionVisitor; +import org.apache.doris.nereids.types.DecimalV3Type; import org.apache.doris.nereids.types.DoubleType; import org.apache.doris.nereids.types.IntegerType; @@ -38,9 +39,10 @@ public class Dround extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullable, ComputePrecisionForRound { public static final List SIGNATURES = ImmutableList.of( - // TODO: decimal FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE), - FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE, IntegerType.INSTANCE) + FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE, IntegerType.INSTANCE), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD, IntegerType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Floor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Floor.java index 380bb33431..9e9f2c7d7b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Floor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Floor.java @@ -24,7 +24,9 @@ import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSi 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.visitor.ExpressionVisitor; +import org.apache.doris.nereids.types.DecimalV3Type; import org.apache.doris.nereids.types.DoubleType; +import org.apache.doris.nereids.types.IntegerType; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; @@ -38,7 +40,9 @@ public class Floor extends ScalarFunction implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullable, ComputePrecisionForRound { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE) + FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD, IntegerType.INSTANCE) ); /** @@ -48,13 +52,24 @@ public class Floor extends ScalarFunction super("floor", arg); } + /** + * constructor with 2 argument. + */ + public Floor(Expression arg0, Expression arg1) { + super("floor", arg0, arg1); + } + /** * withChildren. */ @Override public Floor withChildren(List children) { - Preconditions.checkArgument(children.size() == 1); - return new Floor(children.get(0)); + Preconditions.checkArgument(children.size() == 1 || children.size() == 2); + if (children.size() == 1) { + return new Floor(children.get(0)); + } else { + return new Floor(children.get(0), children.get(1)); + } } @Override diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Round.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Round.java index 3ba213ab33..7f0e266acc 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Round.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Round.java @@ -23,6 +23,7 @@ import org.apache.doris.nereids.trees.expressions.functions.ComputePrecisionForR 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.visitor.ExpressionVisitor; +import org.apache.doris.nereids.types.DecimalV3Type; import org.apache.doris.nereids.types.DoubleType; import org.apache.doris.nereids.types.IntegerType; @@ -39,7 +40,9 @@ public class Round extends ScalarFunction public static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE), - FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE, IntegerType.INSTANCE) + FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE, IntegerType.INSTANCE), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD, IntegerType.INSTANCE) ); /** @@ -61,8 +64,7 @@ public class Round extends ScalarFunction */ @Override public Round withChildren(List children) { - Preconditions.checkArgument(children.size() == 1 - || children.size() == 2); + Preconditions.checkArgument(children.size() == 1 || children.size() == 2); if (children.size() == 1) { return new Round(children.get(0)); } else { diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/RoundBankers.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/RoundBankers.java index e8e36ea82a..5697ae277e 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/RoundBankers.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/RoundBankers.java @@ -23,6 +23,7 @@ import org.apache.doris.nereids.trees.expressions.functions.ComputePrecisionForR 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.visitor.ExpressionVisitor; +import org.apache.doris.nereids.types.DecimalV3Type; import org.apache.doris.nereids.types.DoubleType; import org.apache.doris.nereids.types.IntegerType; @@ -39,7 +40,9 @@ public class RoundBankers extends ScalarFunction public static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE), - FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE, IntegerType.INSTANCE) + FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE, IntegerType.INSTANCE), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD, IntegerType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Truncate.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Truncate.java index 022bf5cd1d..83af5293cd 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Truncate.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Truncate.java @@ -24,6 +24,7 @@ import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSi 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.DecimalV3Type; import org.apache.doris.nereids.types.DoubleType; import org.apache.doris.nereids.types.IntegerType; @@ -39,7 +40,8 @@ public class Truncate extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, PropagateNullable, ComputePrecisionForRound { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE, IntegerType.INSTANCE) + FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE, IntegerType.INSTANCE), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DecimalV3Type.WILDCARD, IntegerType.INSTANCE) ); /** diff --git a/regression-test/data/nereids_function_p0/scalar_function/C.out b/regression-test/data/nereids_function_p0/scalar_function/C.out index 11db4ba493..607f08be34 100644 --- a/regression-test/data/nereids_function_p0/scalar_function/C.out +++ b/regression-test/data/nereids_function_p0/scalar_function/C.out @@ -57,6 +57,180 @@ 2.0 2.0 +-- !sql_ceil_DecimalV3S1 -- +\N +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 + +-- !sql_ceil_DecimalV3S1_notnull -- +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 + +-- !sql_ceil_DecimalV3S2 -- +\N +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 + +-- !sql_ceil_DecimalV3S2_notnull -- +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 + +-- !sql_ceil_DecimalV3S3 -- +\N +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 + +-- !sql_ceil_DecimalV3S3_notnull -- +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 + +-- !sql_ceil_DecimalV3S1_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_ceil_DecimalV3S1_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_ceil_DecimalV3S2_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_ceil_DecimalV3S2_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_ceil_DecimalV3S3_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_ceil_DecimalV3S3_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + -- !sql_character_length_Varchar -- 4 9 diff --git a/regression-test/data/nereids_function_p0/scalar_function/D.out b/regression-test/data/nereids_function_p0/scalar_function/D.out index 6e093e17d0..48a586d5b7 100644 --- a/regression-test/data/nereids_function_p0/scalar_function/D.out +++ b/regression-test/data/nereids_function_p0/scalar_function/D.out @@ -2261,6 +2261,180 @@ Monday 2.0 2.0 +-- !sql_dceil_DecimalV3S1 -- +\N +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 + +-- !sql_dceil_DecimalV3S1_notnull -- +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 + +-- !sql_dceil_DecimalV3S2 -- +\N +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 + +-- !sql_dceil_DecimalV3S2_notnull -- +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 + +-- !sql_dceil_DecimalV3S3 -- +\N +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 + +-- !sql_dceil_DecimalV3S3_notnull -- +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 + +-- !sql_dceil_DecimalV3S1_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dceil_DecimalV3S1_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dceil_DecimalV3S2_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dceil_DecimalV3S2_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dceil_DecimalV3S3_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dceil_DecimalV3S3_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + -- !sql_degrees_Double -- \N 5.729577951308232 @@ -2348,6 +2522,180 @@ Monday 1.0 1.0 +-- !sql_dfloor_DecimalV3S1 -- +\N +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 + +-- !sql_dfloor_DecimalV3S1_notnull -- +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 + +-- !sql_dfloor_DecimalV3S2 -- +\N +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 + +-- !sql_dfloor_DecimalV3S2_notnull -- +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 + +-- !sql_dfloor_DecimalV3S3 -- +\N +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 + +-- !sql_dfloor_DecimalV3S3_notnull -- +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 + +-- !sql_dfloor_DecimalV3S1_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dfloor_DecimalV3S1_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dfloor_DecimalV3S2_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dfloor_DecimalV3S2_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dfloor_DecimalV3S3_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dfloor_DecimalV3S3_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + -- !sql_digital_masking_BigInt -- \N 1****1 @@ -2580,6 +2928,180 @@ Monday 1.1 1.2 +-- !sql_dround_DecimalV3S1 -- +\N +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_dround_DecimalV3S1_notnull -- +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_dround_DecimalV3S2 -- +\N +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_dround_DecimalV3S2_notnull -- +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_dround_DecimalV3S3 -- +\N +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_dround_DecimalV3S3_notnull -- +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_dround_DecimalV3S1_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dround_DecimalV3S1_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dround_DecimalV3S2_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dround_DecimalV3S2_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dround_DecimalV3S3_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_dround_DecimalV3S3_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + -- !sql_dsqrt_Double -- \N 0.31622776601683794 diff --git a/regression-test/data/nereids_function_p0/scalar_function/F.out b/regression-test/data/nereids_function_p0/scalar_function/F.out index f26199f4e9..2009560233 100644 --- a/regression-test/data/nereids_function_p0/scalar_function/F.out +++ b/regression-test/data/nereids_function_p0/scalar_function/F.out @@ -434,6 +434,180 @@ 1.0 1.0 +-- !sql_floor_DecimalV3S1 -- +\N +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 + +-- !sql_floor_DecimalV3S1_notnull -- +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 + +-- !sql_floor_DecimalV3S2 -- +\N +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 + +-- !sql_floor_DecimalV3S2_notnull -- +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 + +-- !sql_floor_DecimalV3S3 -- +\N +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 + +-- !sql_floor_DecimalV3S3_notnull -- +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 + +-- !sql_floor_DecimalV3S1_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_floor_DecimalV3S1_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_floor_DecimalV3S2_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_floor_DecimalV3S2_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_floor_DecimalV3S3_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_floor_DecimalV3S3_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + -- !sql_fmod_Float_Float -- \N 0.0 diff --git a/regression-test/data/nereids_function_p0/scalar_function/R.out b/regression-test/data/nereids_function_p0/scalar_function/R.out index 3ca4942ba2..3145c2c6dc 100644 --- a/regression-test/data/nereids_function_p0/scalar_function/R.out +++ b/regression-test/data/nereids_function_p0/scalar_function/R.out @@ -492,6 +492,180 @@ string3 1.1 1.2 +-- !sql_round_DecimalV3S1 -- +\N +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_round_DecimalV3S1_notnull -- +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_round_DecimalV3S2 -- +\N +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_round_DecimalV3S2_notnull -- +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_round_DecimalV3S3 -- +\N +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_round_DecimalV3S3_notnull -- +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_round_DecimalV3S1_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_round_DecimalV3S1_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_round_DecimalV3S2_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_round_DecimalV3S2_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_round_DecimalV3S3_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_round_DecimalV3S3_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + -- !sql_round_bankers_Double -- \N 0.0 @@ -550,6 +724,180 @@ string3 1.1 1.2 +-- !sql_round_bankers_DecimalV3S1 -- +\N +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_round_bankers_DecimalV3S1_notnull -- +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_round_bankers_DecimalV3S2 -- +\N +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_round_bankers_DecimalV3S2_notnull -- +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_round_bankers_DecimalV3S3 -- +\N +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_round_bankers_DecimalV3S3_notnull -- +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 + +-- !sql_round_bankers_DecimalV3S1_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_round_bankers_DecimalV3S1_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_round_bankers_DecimalV3S2_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_round_bankers_DecimalV3S2_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_round_bankers_DecimalV3S3_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_round_bankers_DecimalV3S3_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + -- !sql_rpad_Varchar_Integer_Varchar -- \N v diff --git a/regression-test/data/nereids_function_p0/scalar_function/T.out b/regression-test/data/nereids_function_p0/scalar_function/T.out index dac93dce42..028d20a7d9 100644 --- a/regression-test/data/nereids_function_p0/scalar_function/T.out +++ b/regression-test/data/nereids_function_p0/scalar_function/T.out @@ -811,3 +811,90 @@ string3 1.1 1.2 +-- !sql_truncate_DecimalV3S1_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_truncate_DecimalV3S1_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_truncate_DecimalV3S2_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_truncate_DecimalV3S2_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_truncate_DecimalV3S3_Int -- +\N +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + +-- !sql_truncate_DecimalV3S3_Int_notnull -- +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +1.2 + diff --git a/regression-test/suites/nereids_function_p0/scalar_function/C.groovy b/regression-test/suites/nereids_function_p0/scalar_function/C.groovy index ea5e15cd63..e6b124e9a3 100644 --- a/regression-test/suites/nereids_function_p0/scalar_function/C.groovy +++ b/regression-test/suites/nereids_function_p0/scalar_function/C.groovy @@ -23,6 +23,18 @@ suite("nereids_scalar_fn_C") { qt_sql_cbrt_Double_notnull "select cbrt(kdbl) from fn_test_not_nullable order by kdbl" qt_sql_ceil_Double "select ceil(kdbl) from fn_test order by kdbl" qt_sql_ceil_Double_notnull "select ceil(kdbl) from fn_test_not_nullable order by kdbl" + qt_sql_ceil_DecimalV3S1 "select ceil(kdcmlv3s1) from fn_test order by kdcmlv3s1" + qt_sql_ceil_DecimalV3S1_notnull "select ceil(kdcmlv3s1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_ceil_DecimalV3S2 "select ceil(kdcmlv3s2) from fn_test order by kdcmlv3s2" + qt_sql_ceil_DecimalV3S2_notnull "select ceil(kdcmlv3s2) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_ceil_DecimalV3S3 "select ceil(kdcmlv3s3) from fn_test order by kdcmlv3s3" + qt_sql_ceil_DecimalV3S3_notnull "select ceil(kdcmlv3s3) from fn_test_not_nullable order by kdcmlv3s3" + qt_sql_ceil_DecimalV3S1_Int "select ceil(kdcmlv3s1, 1) from fn_test order by kdcmlv3s1" + qt_sql_ceil_DecimalV3S1_Int_notnull "select ceil(kdcmlv3s1, 1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_ceil_DecimalV3S2_Int "select ceil(kdcmlv3s2, 1) from fn_test order by kdcmlv3s2" + qt_sql_ceil_DecimalV3S2_Int_notnull "select ceil(kdcmlv3s2, 1) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_ceil_DecimalV3S3_Int "select ceil(kdcmlv3s3, 1) from fn_test order by kdcmlv3s3" + qt_sql_ceil_DecimalV3S3_Int_notnull "select ceil(kdcmlv3s3, 1) from fn_test_not_nullable order by kdcmlv3s3" qt_sql_character_length_Varchar "select character_length(kvchrs1) from fn_test order by kvchrs1" qt_sql_character_length_Varchar_notnull "select character_length(kvchrs1) from fn_test_not_nullable order by kvchrs1" qt_sql_character_length_String "select character_length(kstr) from fn_test order by kstr" @@ -81,4 +93,4 @@ suite("nereids_scalar_fn_C") { qt_sql_cos_Double_notnull "select cos(kdbl) from fn_test_not_nullable order by kdbl" sql "select current_user() from fn_test" sql "select current_user() from fn_test_not_nullable" -} \ No newline at end of file +} diff --git a/regression-test/suites/nereids_function_p0/scalar_function/D.groovy b/regression-test/suites/nereids_function_p0/scalar_function/D.groovy index caa3747867..6b179db073 100644 --- a/regression-test/suites/nereids_function_p0/scalar_function/D.groovy +++ b/regression-test/suites/nereids_function_p0/scalar_function/D.groovy @@ -177,12 +177,36 @@ suite("nereids_scalar_fn_D") { qt_sql_days_sub_DateV2_Integer_notnull "select days_sub(kdtv2, kint) from fn_test_not_nullable order by kdtv2, kint" qt_sql_dceil_Double "select dceil(kdbl) from fn_test order by kdbl" qt_sql_dceil_Double_notnull "select dceil(kdbl) from fn_test_not_nullable order by kdbl" + qt_sql_dceil_DecimalV3S1 "select dceil(kdcmlv3s1) from fn_test order by kdcmlv3s1" + qt_sql_dceil_DecimalV3S1_notnull "select dceil(kdcmlv3s1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_dceil_DecimalV3S2 "select dceil(kdcmlv3s2) from fn_test order by kdcmlv3s2" + qt_sql_dceil_DecimalV3S2_notnull "select dceil(kdcmlv3s2) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_dceil_DecimalV3S3 "select dceil(kdcmlv3s3) from fn_test order by kdcmlv3s3" + qt_sql_dceil_DecimalV3S3_notnull "select dceil(kdcmlv3s3) from fn_test_not_nullable order by kdcmlv3s3" + qt_sql_dceil_DecimalV3S1_Int "select dceil(kdcmlv3s1, 1) from fn_test order by kdcmlv3s1" + qt_sql_dceil_DecimalV3S1_Int_notnull "select dceil(kdcmlv3s1, 1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_dceil_DecimalV3S2_Int "select dceil(kdcmlv3s2, 1) from fn_test order by kdcmlv3s2" + qt_sql_dceil_DecimalV3S2_Int_notnull "select dceil(kdcmlv3s2, 1) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_dceil_DecimalV3S3_Int "select dceil(kdcmlv3s3, 1) from fn_test order by kdcmlv3s3" + qt_sql_dceil_DecimalV3S3_Int_notnull "select dceil(kdcmlv3s3, 1) from fn_test_not_nullable order by kdcmlv3s3" qt_sql_degrees_Double "select degrees(kdbl) from fn_test order by kdbl" qt_sql_degrees_Double_notnull "select degrees(kdbl) from fn_test_not_nullable order by kdbl" qt_sql_dexp_Double "select dexp(kdbl) from fn_test order by kdbl" qt_sql_dexp_Double_notnull "select dexp(kdbl) from fn_test_not_nullable order by kdbl" qt_sql_dfloor_Double "select dfloor(kdbl) from fn_test order by kdbl" qt_sql_dfloor_Double_notnull "select dfloor(kdbl) from fn_test_not_nullable order by kdbl" + qt_sql_dfloor_DecimalV3S1 "select dfloor(kdcmlv3s1) from fn_test order by kdcmlv3s1" + qt_sql_dfloor_DecimalV3S1_notnull "select dfloor(kdcmlv3s1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_dfloor_DecimalV3S2 "select dfloor(kdcmlv3s2) from fn_test order by kdcmlv3s2" + qt_sql_dfloor_DecimalV3S2_notnull "select dfloor(kdcmlv3s2) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_dfloor_DecimalV3S3 "select dfloor(kdcmlv3s3) from fn_test order by kdcmlv3s3" + qt_sql_dfloor_DecimalV3S3_notnull "select dfloor(kdcmlv3s3) from fn_test_not_nullable order by kdcmlv3s3" + qt_sql_dfloor_DecimalV3S1_Int "select dfloor(kdcmlv3s1, 1) from fn_test order by kdcmlv3s1" + qt_sql_dfloor_DecimalV3S1_Int_notnull "select dfloor(kdcmlv3s1, 1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_dfloor_DecimalV3S2_Int "select dfloor(kdcmlv3s2, 1) from fn_test order by kdcmlv3s2" + qt_sql_dfloor_DecimalV3S2_Int_notnull "select dfloor(kdcmlv3s2, 1) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_dfloor_DecimalV3S3_Int "select dfloor(kdcmlv3s3, 1) from fn_test order by kdcmlv3s3" + qt_sql_dfloor_DecimalV3S3_Int_notnull "select dfloor(kdcmlv3s3, 1) from fn_test_not_nullable order by kdcmlv3s3" qt_sql_digital_masking_BigInt "select digital_masking(kbint) from fn_test order by kbint" qt_sql_digital_masking_BigInt_notnull "select digital_masking(kbint) from fn_test_not_nullable order by kbint" qt_sql_dlog1_Double "select dlog1(kdbl) from fn_test order by kdbl" @@ -199,6 +223,18 @@ suite("nereids_scalar_fn_D") { qt_sql_dround_Double_notnull "select dround(kdbl) from fn_test_not_nullable order by kdbl" qt_sql_dround_Double_Integer "select dround(kdbl, 2) from fn_test order by kdbl" qt_sql_dround_Double_Integer_notnull "select dround(kdbl, 2) from fn_test_not_nullable order by kdbl" + qt_sql_dround_DecimalV3S1 "select dround(kdcmlv3s1) from fn_test order by kdcmlv3s1" + qt_sql_dround_DecimalV3S1_notnull "select dround(kdcmlv3s1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_dround_DecimalV3S2 "select dround(kdcmlv3s2) from fn_test order by kdcmlv3s2" + qt_sql_dround_DecimalV3S2_notnull "select dround(kdcmlv3s2) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_dround_DecimalV3S3 "select dround(kdcmlv3s3) from fn_test order by kdcmlv3s3" + qt_sql_dround_DecimalV3S3_notnull "select dround(kdcmlv3s3) from fn_test_not_nullable order by kdcmlv3s3" + qt_sql_dround_DecimalV3S1_Int "select dround(kdcmlv3s1, 1) from fn_test order by kdcmlv3s1" + qt_sql_dround_DecimalV3S1_Int_notnull "select dround(kdcmlv3s1, 1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_dround_DecimalV3S2_Int "select dround(kdcmlv3s2, 1) from fn_test order by kdcmlv3s2" + qt_sql_dround_DecimalV3S2_Int_notnull "select dround(kdcmlv3s2, 1) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_dround_DecimalV3S3_Int "select dround(kdcmlv3s3, 1) from fn_test order by kdcmlv3s3" + qt_sql_dround_DecimalV3S3_Int_notnull "select dround(kdcmlv3s3, 1) from fn_test_not_nullable order by kdcmlv3s3" qt_sql_dsqrt_Double "select dsqrt(kdbl) from fn_test order by kdbl" qt_sql_dsqrt_Double_notnull "select dsqrt(kdbl) from fn_test_not_nullable order by kdbl" -} \ No newline at end of file +} diff --git a/regression-test/suites/nereids_function_p0/scalar_function/F.groovy b/regression-test/suites/nereids_function_p0/scalar_function/F.groovy index 0071b97ca3..a89f3dc9ea 100644 --- a/regression-test/suites/nereids_function_p0/scalar_function/F.groovy +++ b/regression-test/suites/nereids_function_p0/scalar_function/F.groovy @@ -49,6 +49,18 @@ suite("nereids_scalar_fn_F") { qt_sql_find_in_set_String_String_notnull "select find_in_set(kstr, kstr) from fn_test_not_nullable order by kstr, kstr" qt_sql_floor_Double "select floor(kdbl) from fn_test order by kdbl" qt_sql_floor_Double_notnull "select floor(kdbl) from fn_test_not_nullable order by kdbl" + qt_sql_floor_DecimalV3S1 "select floor(kdcmlv3s1) from fn_test order by kdcmlv3s1" + qt_sql_floor_DecimalV3S1_notnull "select floor(kdcmlv3s1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_floor_DecimalV3S2 "select floor(kdcmlv3s2) from fn_test order by kdcmlv3s2" + qt_sql_floor_DecimalV3S2_notnull "select floor(kdcmlv3s2) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_floor_DecimalV3S3 "select floor(kdcmlv3s3) from fn_test order by kdcmlv3s3" + qt_sql_floor_DecimalV3S3_notnull "select floor(kdcmlv3s3) from fn_test_not_nullable order by kdcmlv3s3" + qt_sql_floor_DecimalV3S1_Int "select floor(kdcmlv3s1, 1) from fn_test order by kdcmlv3s1" + qt_sql_floor_DecimalV3S1_Int_notnull "select floor(kdcmlv3s1, 1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_floor_DecimalV3S2_Int "select floor(kdcmlv3s2, 1) from fn_test order by kdcmlv3s2" + qt_sql_floor_DecimalV3S2_Int_notnull "select floor(kdcmlv3s2, 1) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_floor_DecimalV3S3_Int "select floor(kdcmlv3s3, 1) from fn_test order by kdcmlv3s3" + qt_sql_floor_DecimalV3S3_Int_notnull "select floor(kdcmlv3s3, 1) from fn_test_not_nullable order by kdcmlv3s3" qt_sql_fmod_Float_Float "select fmod(kfloat, kfloat) from fn_test order by kfloat, kfloat" qt_sql_fmod_Float_Float_notnull "select fmod(kfloat, kfloat) from fn_test_not_nullable order by kfloat, kfloat" qt_sql_fmod_Double_Double "select fmod(kdbl, kdbl) from fn_test order by kdbl, kdbl" @@ -67,4 +79,4 @@ suite("nereids_scalar_fn_F") { qt_sql_from_unixtime_Integer_Varchar_notnull "select from_unixtime(kint, 'varchar') from fn_test_not_nullable order by kint" qt_sql_from_unixtime_Integer_String "select from_unixtime(kint, 'string') from fn_test order by kint" qt_sql_from_unixtime_Integer_String_notnull "select from_unixtime(kint, 'string') from fn_test_not_nullable order by kint" -} \ No newline at end of file +} diff --git a/regression-test/suites/nereids_function_p0/scalar_function/R.groovy b/regression-test/suites/nereids_function_p0/scalar_function/R.groovy index 0c09db41f5..9c5c8dce9b 100644 --- a/regression-test/suites/nereids_function_p0/scalar_function/R.groovy +++ b/regression-test/suites/nereids_function_p0/scalar_function/R.groovy @@ -57,10 +57,34 @@ suite("nereids_scalar_fn_R") { qt_sql_round_Double_notnull "select round(kdbl) from fn_test_not_nullable order by kdbl" qt_sql_round_Double_Integer "select round(kdbl, 2) from fn_test order by kdbl" qt_sql_round_Double_Integer_notnull "select round(kdbl, 2) from fn_test_not_nullable order by kdbl" + qt_sql_round_DecimalV3S1 "select round(kdcmlv3s1) from fn_test order by kdcmlv3s1" + qt_sql_round_DecimalV3S1_notnull "select round(kdcmlv3s1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_round_DecimalV3S2 "select round(kdcmlv3s2) from fn_test order by kdcmlv3s2" + qt_sql_round_DecimalV3S2_notnull "select round(kdcmlv3s2) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_round_DecimalV3S3 "select round(kdcmlv3s3) from fn_test order by kdcmlv3s3" + qt_sql_round_DecimalV3S3_notnull "select round(kdcmlv3s3) from fn_test_not_nullable order by kdcmlv3s3" + qt_sql_round_DecimalV3S1_Int "select round(kdcmlv3s1, 1) from fn_test order by kdcmlv3s1" + qt_sql_round_DecimalV3S1_Int_notnull "select round(kdcmlv3s1, 1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_round_DecimalV3S2_Int "select round(kdcmlv3s2, 1) from fn_test order by kdcmlv3s2" + qt_sql_round_DecimalV3S2_Int_notnull "select round(kdcmlv3s2, 1) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_round_DecimalV3S3_Int "select round(kdcmlv3s3, 1) from fn_test order by kdcmlv3s3" + qt_sql_round_DecimalV3S3_Int_notnull "select round(kdcmlv3s3, 1) from fn_test_not_nullable order by kdcmlv3s3" qt_sql_round_bankers_Double "select round_bankers(kdbl) from fn_test order by kdbl" qt_sql_round_bankers_Double_notnull "select round_bankers(kdbl) from fn_test_not_nullable order by kdbl" qt_sql_round_bankers_Double_Integer "select round_bankers(kdbl, 2) from fn_test order by kdbl" qt_sql_round_bankers_Double_Integer_notnull "select round_bankers(kdbl, 2) from fn_test_not_nullable order by kdbl" + qt_sql_round_bankers_DecimalV3S1 "select round_bankers(kdcmlv3s1) from fn_test order by kdcmlv3s1" + qt_sql_round_bankers_DecimalV3S1_notnull "select round_bankers(kdcmlv3s1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_round_bankers_DecimalV3S2 "select round_bankers(kdcmlv3s2) from fn_test order by kdcmlv3s2" + qt_sql_round_bankers_DecimalV3S2_notnull "select round_bankers(kdcmlv3s2) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_round_bankers_DecimalV3S3 "select round_bankers(kdcmlv3s3) from fn_test order by kdcmlv3s3" + qt_sql_round_bankers_DecimalV3S3_notnull "select round_bankers(kdcmlv3s3) from fn_test_not_nullable order by kdcmlv3s3" + qt_sql_round_bankers_DecimalV3S1_Int "select round_bankers(kdcmlv3s1, 1) from fn_test order by kdcmlv3s1" + qt_sql_round_bankers_DecimalV3S1_Int_notnull "select round_bankers(kdcmlv3s1, 1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_round_bankers_DecimalV3S2_Int "select round_bankers(kdcmlv3s2, 1) from fn_test order by kdcmlv3s2" + qt_sql_round_bankers_DecimalV3S2_Int_notnull "select round_bankers(kdcmlv3s2, 1) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_round_bankers_DecimalV3S3_Int "select round_bankers(kdcmlv3s3, 1) from fn_test order by kdcmlv3s3" + qt_sql_round_bankers_DecimalV3S3_Int_notnull "select round_bankers(kdcmlv3s3, 1) from fn_test_not_nullable order by kdcmlv3s3" qt_sql_rpad_Varchar_Integer_Varchar "select rpad(kvchrs1, kint, kvchrs1) from fn_test order by kvchrs1, kint, kvchrs1" qt_sql_rpad_Varchar_Integer_Varchar_notnull "select rpad(kvchrs1, kint, kvchrs1) from fn_test_not_nullable order by kvchrs1, kint, kvchrs1" qt_sql_rpad_String_Integer_String "select rpad(kstr, kint, kstr) from fn_test order by kstr, kint, kstr" @@ -93,4 +117,4 @@ suite("nereids_scalar_fn_R") { sql "select cast(running_difference(kdtm) as string) from fn_test order by kdtm" sql "select cast(running_difference(kdtmv2s1) as string) from fn_test order by kdtmv2s1" sql "select cast(running_difference(kdtmv2s1) as string) from fn_test order by kdtmv2s1" -} \ No newline at end of file +} diff --git a/regression-test/suites/nereids_function_p0/scalar_function/T.groovy b/regression-test/suites/nereids_function_p0/scalar_function/T.groovy index 701161f452..e47878b442 100644 --- a/regression-test/suites/nereids_function_p0/scalar_function/T.groovy +++ b/regression-test/suites/nereids_function_p0/scalar_function/T.groovy @@ -75,4 +75,10 @@ suite("nereids_scalar_fn_T") { qt_sql_trim_String_notnull "select trim(kstr) from fn_test_not_nullable order by kstr" qt_sql_truncate_Double_Integer "select truncate(kdbl, 2) from fn_test order by kdbl" qt_sql_truncate_Double_Integer_notnull "select truncate(kdbl, 2) from fn_test_not_nullable order by kdbl" -} \ No newline at end of file + qt_sql_truncate_DecimalV3S1_Int "select truncate(kdcmlv3s1, 1) from fn_test order by kdcmlv3s1" + qt_sql_truncate_DecimalV3S1_Int_notnull "select truncate(kdcmlv3s1, 1) from fn_test_not_nullable order by kdcmlv3s1" + qt_sql_truncate_DecimalV3S2_Int "select truncate(kdcmlv3s2, 1) from fn_test order by kdcmlv3s2" + qt_sql_truncate_DecimalV3S2_Int_notnull "select truncate(kdcmlv3s2, 1) from fn_test_not_nullable order by kdcmlv3s2" + qt_sql_truncate_DecimalV3S3_Int "select truncate(kdcmlv3s3, 1) from fn_test order by kdcmlv3s3" + qt_sql_truncate_DecimalV3S3_Int_notnull "select truncate(kdcmlv3s3, 1) from fn_test_not_nullable order by kdcmlv3s3" +}