diff --git a/fe/fe-common/src/main/java/org/apache/doris/catalog/ScalarType.java b/fe/fe-common/src/main/java/org/apache/doris/catalog/ScalarType.java index 5103339f241e4b..aa0694847b63cf 100644 --- a/fe/fe-common/src/main/java/org/apache/doris/catalog/ScalarType.java +++ b/fe/fe-common/src/main/java/org/apache/doris/catalog/ScalarType.java @@ -843,6 +843,16 @@ public String getLenStr() { return lenStr; } + @Override + public boolean isWildcardTimeV2() { + return type == PrimitiveType.TIMEV2 && scale == -1; + } + + @Override + public boolean isWildcardDatetimeV2() { + return type == PrimitiveType.DATETIMEV2 && scale == -1; + } + @Override public boolean isWildcardDecimal() { return (type.isDecimalV2Type() || type.isDecimalV3Type()) @@ -897,12 +907,6 @@ public boolean matchesType(Type t) { return false; } ScalarType scalarType = (ScalarType) t; - if (type == PrimitiveType.VARCHAR && scalarType.isWildcardVarchar()) { - return true; - } - if (type == PrimitiveType.CHAR && scalarType.isWildcardChar()) { - return true; - } if (type.isStringType() && scalarType.isStringType()) { return true; } @@ -917,10 +921,12 @@ public boolean matchesType(Type t) { if (isDecimalV2() && scalarType.isDecimalV2()) { return true; } - if (isDecimalV3() && scalarType.isDecimalV3()) { - return precision == scalarType.precision && scale == scalarType.scale; + if (isDatetimeV2() && scalarType.isWildcardDatetimeV2()) { + Preconditions.checkState(!isWildcardDatetimeV2()); + return true; } - if (isDatetimeV2() && scalarType.isDatetimeV2()) { + if (isTimeV2() && scalarType.isWildcardTimeV2()) { + Preconditions.checkState(!isWildcardTimeV2()); return true; } if (isVariantType() && scalarType.isVariantType()) { diff --git a/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java b/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java index a932172e24d4f0..394aefe8ed362f 100644 --- a/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java +++ b/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java @@ -520,6 +520,14 @@ public boolean isTimeV2() { return isScalarType(PrimitiveType.TIMEV2); } + public boolean isWildcardTimeV2() { + return false; + } + + public boolean isWildcardDatetimeV2() { + return false; + } + public boolean isWildcardDecimal() { return false; } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/SequenceCount.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/SequenceCount.java index 7d72db0253dae5..5cbc0903979a42 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/SequenceCount.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/SequenceCount.java @@ -44,7 +44,7 @@ public class SequenceCount extends NotNullableAggregateFunction FunctionSignature.ret(BigIntType.INSTANCE) .varArgs(StringType.INSTANCE, DateV2Type.INSTANCE, BooleanType.INSTANCE), FunctionSignature.ret(BigIntType.INSTANCE) - .varArgs(StringType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT, BooleanType.INSTANCE) + .varArgs(StringType.INSTANCE, DateTimeV2Type.WILDCARD, BooleanType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/SequenceMatch.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/SequenceMatch.java index 3b4237720a406b..c6cf9e436a451e 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/SequenceMatch.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/SequenceMatch.java @@ -42,7 +42,7 @@ public class SequenceMatch extends NullableAggregateFunction FunctionSignature.ret(BooleanType.INSTANCE) .varArgs(StringType.INSTANCE, DateV2Type.INSTANCE, BooleanType.INSTANCE), FunctionSignature.ret(BooleanType.INSTANCE) - .varArgs(StringType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT, BooleanType.INSTANCE) + .varArgs(StringType.INSTANCE, DateTimeV2Type.WILDCARD, BooleanType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopNWeighted.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopNWeighted.java index 8599cff880efcf..998c001e83189e 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopNWeighted.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopNWeighted.java @@ -77,8 +77,8 @@ public class TopNWeighted extends NullableAggregateFunction .args(DateTimeType.INSTANCE, BigIntType.INSTANCE, IntegerType.INSTANCE), FunctionSignature.ret(ArrayType.of(DateV2Type.INSTANCE)) .args(DateV2Type.INSTANCE, BigIntType.INSTANCE, IntegerType.INSTANCE), - FunctionSignature.ret(ArrayType.of(DateTimeV2Type.SYSTEM_DEFAULT)) - .args(DateTimeV2Type.SYSTEM_DEFAULT, BigIntType.INSTANCE, IntegerType.INSTANCE), + FunctionSignature.ret(ArrayType.of(DateTimeV2Type.WILDCARD)) + .args(DateTimeV2Type.WILDCARD, BigIntType.INSTANCE, IntegerType.INSTANCE), FunctionSignature.ret(ArrayType.of(StringType.INSTANCE)) .args(StringType.INSTANCE, BigIntType.INSTANCE, IntegerType.INSTANCE), FunctionSignature.ret(ArrayType.of(VarcharType.SYSTEM_DEFAULT)) @@ -115,7 +115,7 @@ public class TopNWeighted extends NullableAggregateFunction FunctionSignature.ret(ArrayType.of(DateV2Type.INSTANCE)) .args(DateV2Type.INSTANCE, BigIntType.INSTANCE, IntegerType.INSTANCE, IntegerType.INSTANCE), FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, + .args(DateTimeV2Type.WILDCARD, BigIntType.INSTANCE, IntegerType.INSTANCE, IntegerType.INSTANCE), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/WindowFunnel.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/WindowFunnel.java index 2a7300a3a15038..fe68663ff5ff43 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/WindowFunnel.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/WindowFunnel.java @@ -43,7 +43,7 @@ public class WindowFunnel extends NullableAggregateFunction public static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(IntegerType.INSTANCE) - .varArgs(BigIntType.INSTANCE, StringType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT, + .varArgs(BigIntType.INSTANCE, StringType.INSTANCE, DateTimeV2Type.WILDCARD, BooleanType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/DateTimeExtractAndTransform.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/DateTimeExtractAndTransform.java index 6b3e3d4478eb64..510d4298d983a7 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/DateTimeExtractAndTransform.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/DateTimeExtractAndTransform.java @@ -722,7 +722,7 @@ public static Expression makeTime(BigIntLiteral hour, BigIntLiteral minute, Doub double secondValue = second.getValue(); if (minuteValue < 0 || minuteValue >= 60 || secondValue < 0 || secondValue >= 60) { - return new NullLiteral(TimeV2Type.INSTANCE); + return new NullLiteral(TimeV2Type.SYSTEM_DEFAULT); } if (Math.abs(hourValue) > 838) { hourValue = hourValue > 0 ? 838 : -838; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRange.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRange.java index b7ea7f4b642475..8dc30b1dd517d1 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRange.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRange.java @@ -42,10 +42,10 @@ public class ArrayRange extends ScalarFunction FunctionSignature.ret(ArrayType.of(IntegerType.INSTANCE)).args(IntegerType.INSTANCE, IntegerType.INSTANCE), FunctionSignature.ret(ArrayType.of(IntegerType.INSTANCE)) .args(IntegerType.INSTANCE, IntegerType.INSTANCE, IntegerType.INSTANCE), - FunctionSignature.ret(ArrayType.of(DateTimeV2Type.SYSTEM_DEFAULT)) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(ArrayType.of(DateTimeV2Type.SYSTEM_DEFAULT)) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE) + FunctionSignature.ret(ArrayType.of(DateTimeV2Type.WILDCARD)) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(ArrayType.of(DateTimeV2Type.WILDCARD)) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD, IntegerType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeDayUnit.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeDayUnit.java index c5288ac7bae291..0090c0c871a418 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeDayUnit.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeDayUnit.java @@ -38,8 +38,8 @@ public class ArrayRangeDayUnit extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, AlwaysNullable { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(ArrayType.of(DateTimeV2Type.SYSTEM_DEFAULT)) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE) + FunctionSignature.ret(ArrayType.of(DateTimeV2Type.WILDCARD)) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD, IntegerType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeHourUnit.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeHourUnit.java index 8afec03762ab80..32095e82b68495 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeHourUnit.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeHourUnit.java @@ -38,8 +38,8 @@ public class ArrayRangeHourUnit extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, AlwaysNullable { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(ArrayType.of(DateTimeV2Type.SYSTEM_DEFAULT)) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE) + FunctionSignature.ret(ArrayType.of(DateTimeV2Type.WILDCARD)) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD, IntegerType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeMinuteUnit.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeMinuteUnit.java index 65c4eebafbf9dd..4c08d0144e9d5d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeMinuteUnit.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeMinuteUnit.java @@ -38,8 +38,8 @@ public class ArrayRangeMinuteUnit extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, AlwaysNullable { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(ArrayType.of(DateTimeV2Type.SYSTEM_DEFAULT)) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE) + FunctionSignature.ret(ArrayType.of(DateTimeV2Type.WILDCARD)) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD, IntegerType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeMonthUnit.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeMonthUnit.java index c4ceeb0ba364bd..eb62df28b6967f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeMonthUnit.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeMonthUnit.java @@ -38,8 +38,8 @@ public class ArrayRangeMonthUnit extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, AlwaysNullable { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(ArrayType.of(DateTimeV2Type.SYSTEM_DEFAULT)) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE) + FunctionSignature.ret(ArrayType.of(DateTimeV2Type.WILDCARD)) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD, IntegerType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeQuarterUnit.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeQuarterUnit.java index 8e7b9ec0e1fee0..2f6c47de5f33ed 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeQuarterUnit.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeQuarterUnit.java @@ -38,8 +38,8 @@ public class ArrayRangeQuarterUnit extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, AlwaysNullable { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(ArrayType.of(DateTimeV2Type.SYSTEM_DEFAULT)) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE) + FunctionSignature.ret(ArrayType.of(DateTimeV2Type.WILDCARD)) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD, IntegerType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeSecondUnit.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeSecondUnit.java index 876caac65bc49e..e9033aa47ec926 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeSecondUnit.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeSecondUnit.java @@ -38,8 +38,8 @@ public class ArrayRangeSecondUnit extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, AlwaysNullable { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(ArrayType.of(DateTimeV2Type.SYSTEM_DEFAULT)) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE) + FunctionSignature.ret(ArrayType.of(DateTimeV2Type.WILDCARD)) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD, IntegerType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeWeekUnit.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeWeekUnit.java index 4d96f3240595fa..127a3de73c7caa 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeWeekUnit.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeWeekUnit.java @@ -38,8 +38,8 @@ public class ArrayRangeWeekUnit extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, AlwaysNullable { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(ArrayType.of(DateTimeV2Type.SYSTEM_DEFAULT)) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE) + FunctionSignature.ret(ArrayType.of(DateTimeV2Type.WILDCARD)) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD, IntegerType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeYearUnit.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeYearUnit.java index 36331e9ad2ae33..1ec1ee61c05fe1 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeYearUnit.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayRangeYearUnit.java @@ -38,8 +38,8 @@ public class ArrayRangeYearUnit extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, AlwaysNullable { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(ArrayType.of(DateTimeV2Type.SYSTEM_DEFAULT)) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE) + FunctionSignature.ret(ArrayType.of(DateTimeV2Type.WILDCARD)) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD, IntegerType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ConvertTz.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ConvertTz.java index 15387474ce690d..6a95bf0b1493b6 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ConvertTz.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ConvertTz.java @@ -44,8 +44,8 @@ public class ConvertTz extends ScalarFunction implements TernaryExpression, ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, Monotonic { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT) + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CurrentTime.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CurrentTime.java index 454294727aa62a..c80c81f82ea435 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CurrentTime.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CurrentTime.java @@ -41,8 +41,8 @@ public class CurrentTime extends ScalarFunction implements LeafExpression, ImplicitlyCastableSignature, AlwaysNotNullable, ComputeSignature { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(TimeV2Type.INSTANCE).args(), - FunctionSignature.ret(TimeV2Type.INSTANCE).args(TinyIntType.INSTANCE) + FunctionSignature.ret(TimeV2Type.SYSTEM_DEFAULT).args(), + FunctionSignature.ret(TimeV2Type.WILDCARD).args(TinyIntType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateDiff.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateDiff.java index 02b5c06071d3a0..dff9a7ec6647d2 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateDiff.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateDiff.java @@ -41,7 +41,7 @@ public class DateDiff extends ScalarFunction public static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(IntegerType.INSTANCE) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), FunctionSignature.ret(IntegerType.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(IntegerType.INSTANCE).args(DateTimeType.INSTANCE, DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateFormat.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateFormat.java index 7cc006a81f4251..58a1faa5680683 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateFormat.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateFormat.java @@ -46,7 +46,7 @@ public class DateFormat extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, PropagateNullable, PropagateNullLiteral, Monotonic { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, + FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(DateTimeV2Type.WILDCARD, VarcharType.SYSTEM_DEFAULT), FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(DateV2Type.INSTANCE, VarcharType.SYSTEM_DEFAULT), FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(DateTimeType.INSTANCE, VarcharType.SYSTEM_DEFAULT), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateTrunc.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateTrunc.java index 5c969fd2100673..e621ba8faf2894 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateTrunc.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateTrunc.java @@ -107,23 +107,23 @@ public FunctionSignature customSignature() { boolean secondArgIsStringLiteral = getArgument(1).isConstant() && getArgument(1) instanceof StringLikeLiteral; if (firstArgIsStringLiteral && !secondArgIsStringLiteral) { - return FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(VarcharType.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT); + return FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(VarcharType.SYSTEM_DEFAULT, DateTimeV2Type.WILDCARD); } else if (!firstArgIsStringLiteral && secondArgIsStringLiteral) { - return FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT); + return FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, VarcharType.SYSTEM_DEFAULT); } else if (firstArgIsStringLiteral && secondArgIsStringLiteral) { boolean timeUnitIsFirst = LEGAL_TIME_UNIT.contains(((StringLikeLiteral) getArgument(0)) .getStringValue().toLowerCase()); - return timeUnitIsFirst ? FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(VarcharType.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT) - : FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT); + return timeUnitIsFirst ? FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(VarcharType.SYSTEM_DEFAULT, DateTimeV2Type.WILDCARD) + : FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, VarcharType.SYSTEM_DEFAULT); } // if both of args are not constant, `checkLegalityBeforeTypeCoercion` will throw exception so just return // a signature here. - return FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(VarcharType.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT); + return FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(VarcharType.SYSTEM_DEFAULT, DateTimeV2Type.WILDCARD); } @Override diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayCeil.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayCeil.java index bfba969999a60b..862f6e58d7938f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayCeil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayCeil.java @@ -40,13 +40,13 @@ public class DayCeil extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, DateCeilFloorMonotonic { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayFloor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayFloor.java index 8386fa3e2b318f..732f7b680466e2 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayFloor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayFloor.java @@ -40,13 +40,13 @@ public class DayFloor extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, DateCeilFloorMonotonic { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayName.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayName.java index d8caf304ccd956..a89bee4ae5ff2b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayName.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayName.java @@ -41,7 +41,7 @@ public class DayName extends ScalarFunction public static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(DateV2Type.INSTANCE), - FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayOfMonth.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayOfMonth.java index 490fcbdaf9ca5c..ba448bfc8e7831 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayOfMonth.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayOfMonth.java @@ -44,7 +44,7 @@ public class DayOfMonth extends ScalarFunction public static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(TinyIntType.INSTANCE).args(DateV2Type.INSTANCE), - FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayOfWeek.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayOfWeek.java index 0627b58ae4892b..9417c46e43dcca 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayOfWeek.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayOfWeek.java @@ -41,7 +41,7 @@ public class DayOfWeek extends ScalarFunction public static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(TinyIntType.INSTANCE).args(DateV2Type.INSTANCE), - FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayOfYear.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayOfYear.java index 50e16a79f5fab5..b67a158de99c08 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayOfYear.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayOfYear.java @@ -44,7 +44,7 @@ public class DayOfYear extends ScalarFunction public static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(SmallIntType.INSTANCE).args(DateV2Type.INSTANCE), - FunctionSignature.ret(SmallIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(SmallIntType.INSTANCE).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(SmallIntType.INSTANCE).args(DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaySecondAdd.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaySecondAdd.java index 6a7889982aa82a..6d583e9efb8742 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaySecondAdd.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaySecondAdd.java @@ -40,7 +40,7 @@ public class DaySecondAdd extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, ComputeSignatureForDateArithmetic, PropagateNullableOnDateOrTimeLikeV2Args, DateAddSubMonotonic { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, VarcharType.SYSTEM_DEFAULT)); public DaySecondAdd(Expression arg0, Expression arg1) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaysAdd.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaysAdd.java index 2e1167cc1dd366..1463298c52643c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaysAdd.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaysAdd.java @@ -44,7 +44,7 @@ public class DaysAdd extends ScalarFunction implements BinaryExpression, Explici // the same precedence, but we prefer datetime to avoid data loss. for string literal which could cast to Date // without loss, we handle it by ComputeSignatureForDateArithmetic. private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE)); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaysDiff.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaysDiff.java index 53e63191fed205..7a70826ab8545b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaysDiff.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaysDiff.java @@ -43,7 +43,7 @@ public class DaysDiff extends ScalarFunction implements BinaryExpression, Explic private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(BigIntType.INSTANCE) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), FunctionSignature.ret(BigIntType.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(BigIntType.INSTANCE).args(DateTimeType.INSTANCE, DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaysSub.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaysSub.java index e95574377a5259..576563ff32589d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaysSub.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DaysSub.java @@ -44,8 +44,7 @@ public class DaysSub extends ScalarFunction implements BinaryExpression, Explici // the same precedence, but we prefer datetime to avoid data loss. for string literal which could cast to Date // without loss, we handle it by ComputeSignatureForDateArithmetic. private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, - IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE)); public DaysSub(Expression arg0, Expression arg1) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Field.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Field.java index 342f7a7920ba21..2c634c9f05d0f3 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Field.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Field.java @@ -61,8 +61,7 @@ public class Field extends ScalarFunction .varArgs(DecimalV2Type.SYSTEM_DEFAULT, DecimalV2Type.SYSTEM_DEFAULT), FunctionSignature.ret(IntegerType.INSTANCE).varArgs(DecimalV3Type.WILDCARD, DecimalV3Type.WILDCARD), FunctionSignature.ret(IntegerType.INSTANCE).varArgs(DateV2Type.INSTANCE, DateV2Type.INSTANCE), - FunctionSignature.ret(IntegerType.INSTANCE) - .varArgs(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(IntegerType.INSTANCE).varArgs(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), FunctionSignature.ret(IntegerType.INSTANCE).varArgs(VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT), FunctionSignature.ret(IntegerType.INSTANCE).varArgs(StringType.INSTANCE, StringType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Hour.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Hour.java index 4ceb3391d64353..2dcf6a6491d084 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Hour.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Hour.java @@ -45,10 +45,10 @@ public class Hour extends ScalarFunction implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullableOnDateOrTimeLikeV2Args, Monotonic { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(TinyIntType.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeType.INSTANCE), - FunctionSignature.ret(IntegerType.INSTANCE).args(TimeV2Type.INSTANCE)); + FunctionSignature.ret(IntegerType.INSTANCE).args(TimeV2Type.WILDCARD)); /** * constructor with 1 argument. diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourCeil.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourCeil.java index 93781d2da82d31..1e4152ddad6e1c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourCeil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourCeil.java @@ -39,13 +39,13 @@ public class HourCeil extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, DateCeilFloorMonotonic { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT) + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourFloor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourFloor.java index f5c1e3a369afaf..23515a2b0710ee 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourFloor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourFloor.java @@ -39,13 +39,13 @@ public class HourFloor extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, DateCeilFloorMonotonic { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT) + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HoursAdd.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HoursAdd.java index 5aa790ddc142ea..d0ab4721ef477c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HoursAdd.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HoursAdd.java @@ -39,7 +39,7 @@ public class HoursAdd extends ScalarFunction implements BinaryExpression, Explic PropagateNullableOnDateOrTimeLikeV2Args, DateAddSubMonotonic { public static final List SIGNATURES = ImmutableList.of(FunctionSignature - .ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE)); + .ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE)); public HoursAdd(Expression arg0, Expression arg1) { super("hours_add", arg0, arg1); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HoursDiff.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HoursDiff.java index 29560191ba66ba..1075f2d6bde48f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HoursDiff.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HoursDiff.java @@ -43,7 +43,7 @@ public class HoursDiff extends ScalarFunction implements BinaryExpression, Expli public static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(BigIntType.INSTANCE) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), FunctionSignature.ret(BigIntType.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(BigIntType.INSTANCE).args(DateTimeType.INSTANCE, DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HoursSub.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HoursSub.java index 6cf12106a6958b..68687d7a612165 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HoursSub.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HoursSub.java @@ -39,7 +39,7 @@ public class HoursSub extends ScalarFunction implements BinaryExpression, Explic PropagateNullableOnDateOrTimeLikeV2Args, DateAddSubMonotonic { public static final List SIGNATURES = ImmutableList.of(FunctionSignature - .ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE)); + .ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE)); public HoursSub(Expression arg0, Expression arg1) { super("hours_sub", arg0, arg1); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/LastDay.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/LastDay.java index 1a9934db38b7cf..8c3ac5ef5c7b98 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/LastDay.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/LastDay.java @@ -40,7 +40,7 @@ public class LastDay extends ScalarFunction public static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE), - FunctionSignature.ret(DateV2Type.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT)); + FunctionSignature.ret(DateV2Type.INSTANCE).args(DateTimeV2Type.WILDCARD)); /** * constructor with 1 argument. diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MakeTime.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MakeTime.java index 2c4e8d8038e749..9a97fe4c729877 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MakeTime.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MakeTime.java @@ -36,7 +36,7 @@ */ public class MakeTime extends ScalarFunction implements ExplicitlyCastableSignature, AlwaysNullable { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(TimeV2Type.INSTANCE) + FunctionSignature.ret(TimeV2Type.SYSTEM_DEFAULT) .args(BigIntType.INSTANCE, BigIntType.INSTANCE, BigIntType.INSTANCE), FunctionSignature.ret(TimeV2Type.MAX) .args(BigIntType.INSTANCE, BigIntType.INSTANCE, DoubleType.INSTANCE) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondTimestamp.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondTimestamp.java index 28df071efab709..cbacae6540bbe3 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondTimestamp.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondTimestamp.java @@ -38,7 +38,7 @@ public class MicroSecondTimestamp extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, PropagateNullableOnDateOrTimeLikeV2Args { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(BigIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT)); + FunctionSignature.ret(BigIntType.INSTANCE).args(DateTimeV2Type.WILDCARD)); public MicroSecondTimestamp(Expression arg0) { super("microsecond_timestamp", arg0); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondsAdd.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondsAdd.java index f2aa5509e08b29..3f9d3242591df5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondsAdd.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondsAdd.java @@ -39,7 +39,7 @@ public class MicroSecondsAdd extends ScalarFunction implements BinaryExpression, PropagateNullableOnDateOrTimeLikeV2Args, DateAddSubMonotonic { private static final List SIGNATURES = ImmutableList - .of(FunctionSignature.ret(DateTimeV2Type.MAX).args(DateTimeV2Type.MAX, BigIntType.INSTANCE)); + .of(FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, BigIntType.INSTANCE)); public MicroSecondsAdd(Expression arg0, Expression arg1) { super("microseconds_add", arg0, arg1); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondsDiff.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondsDiff.java index 6d4df3bcfaea4a..58e915477b5934 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondsDiff.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondsDiff.java @@ -41,7 +41,7 @@ public class MicroSecondsDiff extends ScalarFunction implements BinaryExpression private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(BigIntType.INSTANCE) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondsSub.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondsSub.java index b433bdcde0014a..92d9ff4a44ea9c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondsSub.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MicroSecondsSub.java @@ -39,7 +39,7 @@ public class MicroSecondsSub extends ScalarFunction implements BinaryExpression, PropagateNullableOnDateOrTimeLikeV2Args, DateAddSubMonotonic { private static final List SIGNATURES = ImmutableList - .of(FunctionSignature.ret(DateTimeV2Type.MAX).args(DateTimeV2Type.MAX, BigIntType.INSTANCE)); + .of(FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, BigIntType.INSTANCE)); public MicroSecondsSub(Expression arg0, Expression arg1) { super("microseconds_sub", arg0, arg1); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Microsecond.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Microsecond.java index 84737f47c27cd0..a783179c685c73 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Microsecond.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Microsecond.java @@ -42,7 +42,7 @@ public class Microsecond extends ScalarFunction implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullableOnDateOrTimeLikeV2Args, Monotonic { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(IntegerType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT) + FunctionSignature.ret(IntegerType.INSTANCE).args(DateTimeV2Type.WILDCARD) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondTimestamp.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondTimestamp.java index fe23c6f0d6a225..75c2fac429a17a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondTimestamp.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondTimestamp.java @@ -38,7 +38,7 @@ public class MilliSecondTimestamp extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, PropagateNullableOnDateOrTimeLikeV2Args { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(BigIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT)); + FunctionSignature.ret(BigIntType.INSTANCE).args(DateTimeV2Type.WILDCARD)); public MilliSecondTimestamp(Expression arg0) { super("millisecond_timestamp", arg0); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondsAdd.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondsAdd.java index 3be9a5ee809df7..7bc0cd62e4cda4 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondsAdd.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondsAdd.java @@ -39,7 +39,7 @@ public class MilliSecondsAdd extends ScalarFunction implements BinaryExpression, PropagateNullableOnDateOrTimeLikeV2Args, DateAddSubMonotonic { private static final List SIGNATURES = ImmutableList - .of(FunctionSignature.ret(DateTimeV2Type.MAX).args(DateTimeV2Type.MAX, BigIntType.INSTANCE)); + .of(FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, BigIntType.INSTANCE)); public MilliSecondsAdd(Expression arg0, Expression arg1) { super("milliseconds_add", arg0, arg1); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondsDiff.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondsDiff.java index 8688325b1179bd..83ab925850e191 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondsDiff.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondsDiff.java @@ -41,7 +41,7 @@ public class MilliSecondsDiff extends ScalarFunction implements BinaryExpression private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(BigIntType.INSTANCE) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondsSub.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondsSub.java index 155aa676d86910..b3541542f27a70 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondsSub.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MilliSecondsSub.java @@ -39,7 +39,7 @@ public class MilliSecondsSub extends ScalarFunction implements BinaryExpression, PropagateNullableOnDateOrTimeLikeV2Args, DateAddSubMonotonic { private static final List SIGNATURES = ImmutableList - .of(FunctionSignature.ret(DateTimeV2Type.MAX).args(DateTimeV2Type.MAX, BigIntType.INSTANCE)); + .of(FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, BigIntType.INSTANCE)); public MilliSecondsSub(Expression arg0, Expression arg1) { super("milliseconds_sub", arg0, arg1); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Minute.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Minute.java index 986d393d22cc4f..2e8f334c03fae0 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Minute.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Minute.java @@ -45,10 +45,10 @@ public class Minute extends ScalarFunction implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullableOnDateOrTimeLikeV2Args, Monotonic { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeType.INSTANCE), FunctionSignature.ret(TinyIntType.INSTANCE).args(DateV2Type.INSTANCE), - FunctionSignature.ret(TinyIntType.INSTANCE).args(TimeV2Type.INSTANCE)); + FunctionSignature.ret(TinyIntType.INSTANCE).args(TimeV2Type.WILDCARD)); /** * constructor with 1 argument. diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteCeil.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteCeil.java index a8d203f602b6cb..14318d238138c6 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteCeil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteCeil.java @@ -39,13 +39,13 @@ public class MinuteCeil extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, DateCeilFloorMonotonic { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT) + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteFloor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteFloor.java index 8168e989a68e85..2941cf260956d5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteFloor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteFloor.java @@ -39,13 +39,13 @@ public class MinuteFloor extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, DateCeilFloorMonotonic { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT) + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinutesAdd.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinutesAdd.java index 7f0b8d1adc9609..f1fed3e922ac6a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinutesAdd.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinutesAdd.java @@ -39,7 +39,7 @@ public class MinutesAdd extends ScalarFunction implements BinaryExpression, Expl PropagateNullableOnDateOrTimeLikeV2Args, DateAddSubMonotonic { public static final List SIGNATURES = ImmutableList.of(FunctionSignature - .ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, BigIntType.INSTANCE)); + .ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, BigIntType.INSTANCE)); public MinutesAdd(Expression arg0, Expression arg1) { super("minutes_add", arg0, arg1); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinutesDiff.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinutesDiff.java index df095bd909c62e..5fbf412917e8e5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinutesDiff.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinutesDiff.java @@ -43,7 +43,7 @@ public class MinutesDiff extends ScalarFunction implements BinaryExpression, Exp private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(BigIntType.INSTANCE) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), FunctionSignature.ret(BigIntType.INSTANCE).args(DateTimeType.INSTANCE, DateTimeType.INSTANCE), FunctionSignature.ret(BigIntType.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinutesSub.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinutesSub.java index 44fff1f7d1dd2a..7cdde5c1f0a041 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinutesSub.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinutesSub.java @@ -39,7 +39,7 @@ public class MinutesSub extends ScalarFunction implements BinaryExpression, Expl PropagateNullableOnDateOrTimeLikeV2Args, DateAddSubMonotonic { public static final List SIGNATURES = ImmutableList.of(FunctionSignature - .ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, BigIntType.INSTANCE)); + .ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, BigIntType.INSTANCE)); public MinutesSub(Expression arg0, Expression arg1) { super("minutes_sub", arg0, arg1); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthCeil.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthCeil.java index a796af46d600e1..b3e36de12ad255 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthCeil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthCeil.java @@ -40,13 +40,13 @@ public class MonthCeil extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, DateCeilFloorMonotonic { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthFloor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthFloor.java index 992fa202162b2b..e1e6fc2401202f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthFloor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthFloor.java @@ -40,13 +40,13 @@ public class MonthFloor extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, DateCeilFloorMonotonic { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthName.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthName.java index 23d77f9c23ba6c..8f294e27558e36 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthName.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthName.java @@ -41,7 +41,7 @@ public class MonthName extends ScalarFunction private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(DateV2Type.INSTANCE), - FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthsAdd.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthsAdd.java index a90c5e9b53b75d..840eda9e539bd4 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthsAdd.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthsAdd.java @@ -44,7 +44,7 @@ public class MonthsAdd extends ScalarFunction implements BinaryExpression, Expli // the same precedence, but we prefer datetime to avoid data loss. for string literal which could cast to Date // without loss, we handle it by ComputeSignatureForDateArithmetic. private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE)); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthsDiff.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthsDiff.java index fa4f9eedacd88a..ddc70dc23ec6c6 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthsDiff.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthsDiff.java @@ -44,7 +44,7 @@ public class MonthsDiff extends ScalarFunction implements BinaryExpression, Expl private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(BigIntType.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(BigIntType.INSTANCE) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), FunctionSignature.ret(BigIntType.INSTANCE).args(DateTimeType.INSTANCE, DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthsSub.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthsSub.java index 10e80521409b39..190e99b28dc8a5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthsSub.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthsSub.java @@ -44,7 +44,7 @@ public class MonthsSub extends ScalarFunction implements BinaryExpression, Expli // the same precedence, but we prefer datetime to avoid data loss. for string literal which could cast to Date // without loss, we handle it by ComputeSignatureForDateArithmetic. private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE)); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Now.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Now.java index 96ecb9d0a5a5c3..d11801dcc0cfbd 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Now.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Now.java @@ -38,7 +38,7 @@ public class Now extends DateTimeWithPrecision implements ExplicitlyCastableSign public static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(IntegerType.INSTANCE) + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(IntegerType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Quarter.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Quarter.java index 9b528087e18e5d..bd9e4055d032a2 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Quarter.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Quarter.java @@ -44,7 +44,7 @@ public class Quarter extends ScalarFunction public static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeType.INSTANCE), - FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(TinyIntType.INSTANCE).args(DateV2Type.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuarterCeil.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuarterCeil.java index a1f58943f4a6a9..3030f5c7b042c8 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuarterCeil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuarterCeil.java @@ -40,13 +40,13 @@ public class QuarterCeil extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, DateCeilFloorMonotonic { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuarterFloor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuarterFloor.java index e26eb894bef895..8207a725e358e8 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuarterFloor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuarterFloor.java @@ -40,13 +40,13 @@ public class QuarterFloor extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, DateCeilFloorMonotonic { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuartersAdd.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuartersAdd.java index 0cd925c016b89e..757b4d8381d0ab 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuartersAdd.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuartersAdd.java @@ -44,7 +44,7 @@ public class QuartersAdd extends ScalarFunction implements BinaryExpression, Exp // the same precedence, but we prefer datetime to avoid data loss. for string literal which could cast to Date // without loss, we handle it by ComputeSignatureForDateArithmetic. private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE)); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuartersDiff.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuartersDiff.java index 905cd5f3e2dab7..30a4358882c168 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuartersDiff.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuartersDiff.java @@ -43,7 +43,7 @@ public class QuartersDiff extends ScalarFunction implements BinaryExpression, Ex private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(BigIntType.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(BigIntType.INSTANCE) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuartersSub.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuartersSub.java index 71bd8804071b7c..8c3943b9d432ca 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuartersSub.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/QuartersSub.java @@ -44,7 +44,7 @@ public class QuartersSub extends ScalarFunction implements BinaryExpression, Exp // the same precedence, but we prefer datetime to avoid data loss. for string literal which could cast to Date // without loss, we handle it by ComputeSignatureForDateArithmetic. private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE)); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecToTime.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecToTime.java index fd1eaab126a620..2e07caa525d02c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecToTime.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecToTime.java @@ -39,7 +39,7 @@ public class SecToTime extends ScalarFunction implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullable { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(TimeV2Type.INSTANCE).args(IntegerType.INSTANCE), + FunctionSignature.ret(TimeV2Type.SYSTEM_DEFAULT).args(IntegerType.INSTANCE), FunctionSignature.ret(TimeV2Type.MAX).args(DoubleType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Second.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Second.java index 23bf3c9e9a9fa8..0dbcf5f88b717b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Second.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Second.java @@ -45,10 +45,10 @@ public class Second extends ScalarFunction implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullableOnDateOrTimeLikeV2Args, Monotonic { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(TinyIntType.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeType.INSTANCE), - FunctionSignature.ret(TinyIntType.INSTANCE).args(TimeV2Type.INSTANCE)); + FunctionSignature.ret(TinyIntType.INSTANCE).args(TimeV2Type.WILDCARD)); /** * constructor with 1 argument. diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondCeil.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondCeil.java index 2474dae7227e3f..ef7a0f8e186db2 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondCeil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondCeil.java @@ -39,13 +39,13 @@ public class SecondCeil extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, DateCeilFloorMonotonic { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT) + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondFloor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondFloor.java index 56837f0fc9d2e1..0dca88e00cf024 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondFloor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondFloor.java @@ -39,13 +39,13 @@ public class SecondFloor extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, DateCeilFloorMonotonic { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT) + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondTimestamp.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondTimestamp.java index 1f16c36a07055d..a2b6dcd6b8f0c6 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondTimestamp.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondTimestamp.java @@ -38,7 +38,7 @@ public class SecondTimestamp extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, PropagateNullableOnDateOrTimeLikeV2Args { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(BigIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT)); + FunctionSignature.ret(BigIntType.INSTANCE).args(DateTimeV2Type.WILDCARD)); public SecondTimestamp(Expression arg0) { super("second_timestamp", arg0); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondsAdd.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondsAdd.java index 4ca4bfb13f5577..b087a0fdc5d00c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondsAdd.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondsAdd.java @@ -39,7 +39,7 @@ public class SecondsAdd extends ScalarFunction implements BinaryExpression, Expl PropagateNullableOnDateOrTimeLikeV2Args, DateAddSubMonotonic { public static final List SIGNATURES = ImmutableList.of(FunctionSignature - .ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, BigIntType.INSTANCE)); + .ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, BigIntType.INSTANCE)); public SecondsAdd(Expression arg0, Expression arg1) { super("seconds_add", arg0, arg1); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondsDiff.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondsDiff.java index 1db30254f00b69..5bb300f44cf002 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondsDiff.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondsDiff.java @@ -43,7 +43,7 @@ public class SecondsDiff extends ScalarFunction implements BinaryExpression, Exp private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(BigIntType.INSTANCE) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), FunctionSignature.ret(BigIntType.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(BigIntType.INSTANCE).args(DateTimeType.INSTANCE, DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondsSub.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondsSub.java index a99791aee2d81e..4bf5511e566a89 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondsSub.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondsSub.java @@ -39,7 +39,7 @@ public class SecondsSub extends ScalarFunction implements BinaryExpression, Expl PropagateNullableOnDateOrTimeLikeV2Args, DateAddSubMonotonic { public static final List SIGNATURES = ImmutableList.of(FunctionSignature - .ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, BigIntType.INSTANCE)); + .ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, BigIntType.INSTANCE)); public SecondsSub(Expression arg0, Expression arg1) { super("seconds_sub", arg0, arg1); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Time.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Time.java index fab11459c5cdd2..8c18e1b8b0cce0 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Time.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Time.java @@ -38,7 +38,7 @@ public class Time extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, PropagateNullableOnDateOrTimeLikeV2Args { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(TimeV2Type.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT)); + FunctionSignature.ret(TimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD)); /** * constructor with 1 argument. diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/TimeDiff.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/TimeDiff.java index 998fff2ad3481c..49bc7ebbd29ec0 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/TimeDiff.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/TimeDiff.java @@ -39,9 +39,9 @@ public class TimeDiff extends ScalarFunction implements BinaryExpression, ExplicitlyCastableSignature, PropagateNullableOnDateOrTimeLikeV2Args { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(TimeV2Type.INSTANCE) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(TimeV2Type.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE)); + FunctionSignature.ret(TimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(TimeV2Type.SYSTEM_DEFAULT).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE)); /** * constructor with 2 arguments. diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/TimeToSec.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/TimeToSec.java index cdb73a8040482e..03f5a15b1bee27 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/TimeToSec.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/TimeToSec.java @@ -38,7 +38,7 @@ public class TimeToSec extends ScalarFunction implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullable { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(IntegerType.INSTANCE).args(TimeV2Type.INSTANCE)); + FunctionSignature.ret(IntegerType.INSTANCE).args(TimeV2Type.WILDCARD)); /** * constructor with 1 argument. diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Timestamp.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Timestamp.java index 5e083dc602a272..a09d8e26c8043a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Timestamp.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Timestamp.java @@ -40,11 +40,11 @@ public class Timestamp extends ScalarFunction //When enable_date_conversion is true, we prefer to V2 signature. // This preference follows original planner. refer to ScalarType.getDefaultDateType() public static final List SIGNATURES = Config.enable_date_conversion ? ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE) ) : ImmutableList.of( FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT) + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToDate.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToDate.java index f60e7974bd09a8..5adfe6c57e536d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToDate.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToDate.java @@ -42,7 +42,7 @@ public class ToDate extends ScalarFunction implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullable, PropagateNullLiteral, Monotonic { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateV2Type.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(DateV2Type.INSTANCE).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(DateType.INSTANCE).args(DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToDateV2.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToDateV2.java index 589a0daedab45f..31762008d16c5d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToDateV2.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToDateV2.java @@ -39,7 +39,7 @@ public class ToDateV2 extends ScalarFunction implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullable, PropagateNullLiteral { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateV2Type.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT) + FunctionSignature.ret(DateV2Type.INSTANCE).args(DateTimeV2Type.WILDCARD) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToIso8601.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToIso8601.java index b2a773adcbadab..bc205fc8f76e86 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToIso8601.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToIso8601.java @@ -41,7 +41,7 @@ public class ToIso8601 extends ScalarFunction implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullable { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(StringType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(StringType.INSTANCE).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(StringType.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(StringType.INSTANCE).args(DateTimeType.INSTANCE), FunctionSignature.ret(StringType.INSTANCE).args(DateType.INSTANCE) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToJson.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToJson.java index 69aeb286bcc71f..a6e571c23231c6 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToJson.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToJson.java @@ -65,11 +65,11 @@ public class ToJson extends ScalarFunction FunctionSignature.ret(JsonType.INSTANCE).args(FloatType.INSTANCE), FunctionSignature.ret(JsonType.INSTANCE).args(DoubleType.INSTANCE), FunctionSignature.ret(JsonType.INSTANCE).args(DecimalV3Type.WILDCARD), - FunctionSignature.ret(JsonType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(JsonType.INSTANCE).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(JsonType.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(JsonType.INSTANCE).args(IPv4Type.INSTANCE), FunctionSignature.ret(JsonType.INSTANCE).args(IPv6Type.INSTANCE), - FunctionSignature.ret(JsonType.INSTANCE).args(TimeV2Type.INSTANCE), + FunctionSignature.ret(JsonType.INSTANCE).args(TimeV2Type.WILDCARD), FunctionSignature.ret(JsonType.INSTANCE).args(StringType.INSTANCE)); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToMonday.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToMonday.java index 1c149d657a42cf..85d3d123aa4079 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToMonday.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToMonday.java @@ -40,7 +40,7 @@ public class ToMonday extends ScalarFunction private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE), - FunctionSignature.ret(DateV2Type.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT) + FunctionSignature.ret(DateV2Type.INSTANCE).args(DateTimeV2Type.WILDCARD) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UnixTimestamp.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UnixTimestamp.java index bec37b9ce4ab87..084c6c9153bf17 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UnixTimestamp.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UnixTimestamp.java @@ -49,7 +49,7 @@ public class UnixTimestamp extends ScalarFunction // we got changes when computeSignature private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(BigIntType.INSTANCE).args(), - FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(DecimalV3Type.WILDCARD).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(BigIntType.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(BigIntType.INSTANCE).args(DateTimeType.INSTANCE), FunctionSignature.ret(BigIntType.INSTANCE).args(DateType.INSTANCE), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UtcTime.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UtcTime.java index 85c3a4bbb990bc..9210bab252b919 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UtcTime.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UtcTime.java @@ -40,8 +40,8 @@ public class UtcTime extends ScalarFunction implements LeafExpression, ExplicitlyCastableSignature, AlwaysNotNullable { public static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(TimeV2Type.INSTANCE).args(), - FunctionSignature.ret(TimeV2Type.INSTANCE).args(IntegerType.INSTANCE) + FunctionSignature.ret(TimeV2Type.SYSTEM_DEFAULT).args(), + FunctionSignature.ret(TimeV2Type.SYSTEM_DEFAULT).args(IntegerType.INSTANCE) ); /** diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Week.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Week.java index e5a86cb79f161b..03e44642b991fb 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Week.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Week.java @@ -42,8 +42,8 @@ public class Week extends ScalarFunction private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(TinyIntType.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(TinyIntType.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE), - FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), + FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeType.INSTANCE), FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeType.INSTANCE, IntegerType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekCeil.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekCeil.java index ff6d443864ce18..86e88eca5c3b2a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekCeil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekCeil.java @@ -39,13 +39,13 @@ public class WeekCeil extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekFloor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekFloor.java index 526dc72ceb4d42..7c53440c48cf7d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekFloor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekFloor.java @@ -39,13 +39,13 @@ public class WeekFloor extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekOfYear.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekOfYear.java index db69afadd5497e..09df6888d73e04 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekOfYear.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekOfYear.java @@ -41,7 +41,7 @@ public class WeekOfYear extends ScalarFunction private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(TinyIntType.INSTANCE).args(DateV2Type.INSTANCE), - FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Weekday.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Weekday.java index 4de74d27dba077..60acd3dde411e3 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Weekday.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Weekday.java @@ -41,7 +41,7 @@ public class Weekday extends ScalarFunction private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(TinyIntType.INSTANCE).args(DateV2Type.INSTANCE), - FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeeksAdd.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeeksAdd.java index 8d40de6f3e20b4..3cd0fcaa9b2679 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeeksAdd.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeeksAdd.java @@ -44,7 +44,7 @@ public class WeeksAdd extends ScalarFunction implements BinaryExpression, Explic // the same precedence, but we prefer datetime to avoid data loss. for string literal which could cast to Date // without loss, we handle it by ComputeSignatureForDateArithmetic. private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE)); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeeksDiff.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeeksDiff.java index 0c561501d0b9be..c3698962631b8a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeeksDiff.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeeksDiff.java @@ -44,7 +44,7 @@ public class WeeksDiff extends ScalarFunction implements BinaryExpression, Expli private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(BigIntType.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(BigIntType.INSTANCE) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), FunctionSignature.ret(BigIntType.INSTANCE).args(DateTimeType.INSTANCE, DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeeksSub.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeeksSub.java index 188ef52d1b1cdb..ee817b5cf75fc4 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeeksSub.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeeksSub.java @@ -44,7 +44,7 @@ public class WeeksSub extends ScalarFunction implements BinaryExpression, Explic // the same precedence, but we prefer datetime to avoid data loss. for string literal which could cast to Date // without loss, we handle it by ComputeSignatureForDateArithmetic. private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE)); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Year.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Year.java index a1ba5188128489..682a4a9bc610b5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Year.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Year.java @@ -42,7 +42,7 @@ public class Year extends ScalarFunction private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(SmallIntType.INSTANCE).args(DateV2Type.INSTANCE), - FunctionSignature.ret(SmallIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(SmallIntType.INSTANCE).args(DateTimeV2Type.WILDCARD), FunctionSignature.ret(SmallIntType.INSTANCE).args(DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearCeil.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearCeil.java index 5cfbc125631ddf..36feed92bd05f1 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearCeil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearCeil.java @@ -40,13 +40,13 @@ public class YearCeil extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, DateCeilFloorMonotonic { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearFloor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearFloor.java index 077c464fe4df9f..88d9e0a990603a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearFloor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearFloor.java @@ -40,13 +40,13 @@ public class YearFloor extends ScalarFunction implements ExplicitlyCastableSignature, PropagateNullLiteral, PropagateNullable, DateCeilFloorMonotonic { private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) - .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT), + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), + FunctionSignature.ret(DateTimeV2Type.WILDCARD) + .args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE, DateTimeV2Type.WILDCARD), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearWeek.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearWeek.java index 7fe99c0fef1f28..f429e5e32e7d52 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearWeek.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearWeek.java @@ -43,8 +43,8 @@ public class YearWeek extends ScalarFunction private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(IntegerType.INSTANCE).args(DateV2Type.INSTANCE), FunctionSignature.ret(IntegerType.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE), - FunctionSignature.ret(IntegerType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT), - FunctionSignature.ret(IntegerType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE), + FunctionSignature.ret(IntegerType.INSTANCE).args(DateTimeV2Type.WILDCARD), + FunctionSignature.ret(IntegerType.INSTANCE).args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), FunctionSignature.ret(IntegerType.INSTANCE).args(DateTimeType.INSTANCE), FunctionSignature.ret(IntegerType.INSTANCE).args(DateTimeType.INSTANCE, IntegerType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearsAdd.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearsAdd.java index 627269a5a0d35c..2cf79b0a0dfe73 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearsAdd.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearsAdd.java @@ -44,7 +44,7 @@ public class YearsAdd extends ScalarFunction implements BinaryExpression, Explic // the same precedence, but we prefer datetime to avoid data loss. for string literal which could cast to Date // without loss, we handle it by ComputeSignatureForDateArithmetic. private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE)); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearsDiff.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearsDiff.java index 3c75154a4e24d6..457a93c137173d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearsDiff.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearsDiff.java @@ -44,7 +44,7 @@ public class YearsDiff extends ScalarFunction implements BinaryExpression, Expli private static final List SIGNATURES = ImmutableList.of( FunctionSignature.ret(BigIntType.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE), FunctionSignature.ret(BigIntType.INSTANCE) - .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), + .args(DateTimeV2Type.WILDCARD, DateTimeV2Type.WILDCARD), FunctionSignature.ret(BigIntType.INSTANCE).args(DateTimeType.INSTANCE, DateTimeType.INSTANCE) ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearsSub.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearsSub.java index a298327432bc5a..0eccac944eaf85 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearsSub.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearsSub.java @@ -44,7 +44,7 @@ public class YearsSub extends ScalarFunction implements BinaryExpression, Explic // the same precedence, but we prefer datetime to avoid data loss. for string literal which could cast to Date // without loss, we handle it by ComputeSignatureForDateArithmetic. private static final List SIGNATURES = ImmutableList.of( - FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args(DateTimeV2Type.SYSTEM_DEFAULT, + FunctionSignature.ret(DateTimeV2Type.WILDCARD).args(DateTimeV2Type.WILDCARD, IntegerType.INSTANCE), FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, IntegerType.INSTANCE)); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/window/RequireTrivialTypes.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/window/RequireTrivialTypes.java index 4d643a46a900d9..631f795329b181 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/window/RequireTrivialTypes.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/window/RequireTrivialTypes.java @@ -59,8 +59,8 @@ public interface RequireTrivialTypes { DateType.INSTANCE, DateTimeType.INSTANCE, DateV2Type.INSTANCE, - DateTimeV2Type.SYSTEM_DEFAULT, - TimeV2Type.INSTANCE, + DateTimeV2Type.WILDCARD, + TimeV2Type.WILDCARD, VarcharType.SYSTEM_DEFAULT, StringType.INSTANCE ); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java index 6fff5a1883005a..a6db5f210cc9b9 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DataType.java @@ -304,7 +304,7 @@ public static DataType convertPrimitiveFromStrings(List types) { case "timev2": switch (types.size()) { case 1: - dataType = TimeV2Type.INSTANCE; + dataType = TimeV2Type.SYSTEM_DEFAULT; break; case 2: dataType = TimeV2Type.of(Integer.parseInt(types.get(1))); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DateTimeV2Type.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DateTimeV2Type.java index b216b3af3122af..93f1e0bf95641e 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DateTimeV2Type.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DateTimeV2Type.java @@ -27,8 +27,6 @@ import org.apache.doris.nereids.types.coercion.IntegralType; import org.apache.doris.nereids.types.coercion.ScaleTimeType; -import com.google.common.base.Preconditions; - import java.time.DateTimeException; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; @@ -41,13 +39,13 @@ public class DateTimeV2Type extends DateLikeType implements ScaleTimeType { public static final int MAX_SCALE = 6; public static final DateTimeV2Type SYSTEM_DEFAULT = new DateTimeV2Type(0); public static final DateTimeV2Type MAX = new DateTimeV2Type(MAX_SCALE); + public static final DateTimeV2Type WILDCARD = new DateTimeV2Type(-1); private static final int WIDTH = 8; private final int scale; private DateTimeV2Type(int scale) { - Preconditions.checkArgument(0 <= scale && scale <= MAX_SCALE); this.scale = scale; } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DecimalV2Type.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DecimalV2Type.java index 925eabce243fde..9d2acba9e6086b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DecimalV2Type.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/DecimalV2Type.java @@ -64,7 +64,7 @@ public class DecimalV2Type extends FractionalType { .put(LargeIntType.INSTANCE, LARGEINT_DECIMAL) .put(FloatType.INSTANCE, FLOAT_DECIMAL) .put(DoubleType.INSTANCE, DOUBLE_DECIMAL) - .put(TimeV2Type.INSTANCE, DOUBLE_DECIMAL) + .put(TimeV2Type.SYSTEM_DEFAULT, DOUBLE_DECIMAL) .put(NullType.INSTANCE, BOOLEAN_DECIMAL) .build(); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/TimeV2Type.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/TimeV2Type.java index aed3d3195e86a3..39f420e6931032 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/TimeV2Type.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/TimeV2Type.java @@ -33,8 +33,9 @@ public class TimeV2Type extends PrimitiveType implements RangeScalable, ScaleTimeType { public static final int MAX_SCALE = 6; - public static final TimeV2Type INSTANCE = new TimeV2Type(0); + public static final TimeV2Type SYSTEM_DEFAULT = new TimeV2Type(0); public static final TimeV2Type MAX = new TimeV2Type(MAX_SCALE); + public static final TimeV2Type WILDCARD = new TimeV2Type(-1); private static final int WIDTH = 8; private final int scale; @@ -81,7 +82,7 @@ public ScaleTimeType forTypeFromString(StringLikeLiteral str) { */ public static TimeV2Type forTypeFromString(String s) { try { - new TimeV2Literal(INSTANCE, s); + new TimeV2Literal(SYSTEM_DEFAULT, s); } catch (AnalysisException e) { return MAX; } @@ -97,7 +98,7 @@ public static TimeV2Type forType(DataType dataType) { } if (dataType instanceof IntegralType || dataType instanceof BooleanType || dataType instanceof NullType || dataType instanceof DateTimeType) { - return INSTANCE; + return SYSTEM_DEFAULT; } if (dataType instanceof DecimalV3Type) { return TimeV2Type.of(Math.min(((DecimalV3Type) dataType).getScale(), 6)); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java index 0c5771b24b6251..233732233d9c5c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java @@ -2040,7 +2040,9 @@ protected static Optional findCommonPrimitiveTypeForCaseWhen(DataType // time-like vs all other type if (t1.isTimeType() && t2.isTimeType()) { - return Optional.of(TimeV2Type.INSTANCE); + TimeV2Type time1 = (TimeV2Type) t1; + TimeV2Type time2 = (TimeV2Type) t2; + return Optional.of(TimeV2Type.of(Math.max(time1.getScale(), time2.getScale()))); } if (t1.isTimeType() || t2.isTimeType()) { if (t1.isNumericType() || t2.isNumericType() || t1.isBooleanType() || t2.isBooleanType()) { diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/check/CheckCastTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/check/CheckCastTest.java index 7a6cd31fa2302f..0706048afe77e3 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/check/CheckCastTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/check/CheckCastTest.java @@ -918,64 +918,64 @@ public void testCastFromDateTime() { @Test public void testCastFromTime() { // Strict mode - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, BooleanType.INSTANCE, true)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, TinyIntType.INSTANCE, true)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, SmallIntType.INSTANCE, true)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, IntegerType.INSTANCE, true)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, BigIntType.INSTANCE, true)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, LargeIntType.INSTANCE, true)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, FloatType.INSTANCE, true)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, DoubleType.INSTANCE, true)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, DecimalV2Type.SYSTEM_DEFAULT, true)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, DecimalV3Type.SYSTEM_DEFAULT, true)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, DateType.INSTANCE, true)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, DateV2Type.INSTANCE, true)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, DateTimeType.INSTANCE, true)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, DateTimeV2Type.MAX, true)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, TimeV2Type.MAX, true)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, IPv4Type.INSTANCE, true)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, IPv6Type.INSTANCE, true)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, CharType.SYSTEM_DEFAULT, true)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, VarcharType.SYSTEM_DEFAULT, true)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, StringType.INSTANCE, true)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, JsonType.INSTANCE, true)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, VariantType.INSTANCE, true)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, ArrayType.SYSTEM_DEFAULT, true)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, MapType.SYSTEM_DEFAULT, true)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, StructType.SYSTEM_DEFAULT, true)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, HllType.INSTANCE, true)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, BitmapType.INSTANCE, true)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, QuantileStateType.INSTANCE, true)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, BooleanType.INSTANCE, true)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, TinyIntType.INSTANCE, true)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, SmallIntType.INSTANCE, true)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, true)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, BigIntType.INSTANCE, true)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, LargeIntType.INSTANCE, true)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, FloatType.INSTANCE, true)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, DoubleType.INSTANCE, true)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, DecimalV2Type.SYSTEM_DEFAULT, true)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, DecimalV3Type.SYSTEM_DEFAULT, true)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, DateType.INSTANCE, true)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, DateV2Type.INSTANCE, true)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, DateTimeType.INSTANCE, true)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.MAX, true)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, TimeV2Type.MAX, true)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, IPv4Type.INSTANCE, true)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, IPv6Type.INSTANCE, true)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, CharType.SYSTEM_DEFAULT, true)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT, true)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, StringType.INSTANCE, true)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, JsonType.INSTANCE, true)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, VariantType.INSTANCE, true)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, ArrayType.SYSTEM_DEFAULT, true)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, MapType.SYSTEM_DEFAULT, true)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, StructType.SYSTEM_DEFAULT, true)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, HllType.INSTANCE, true)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, BitmapType.INSTANCE, true)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, QuantileStateType.INSTANCE, true)); // Un-strict mode - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, BooleanType.INSTANCE, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, TinyIntType.INSTANCE, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, SmallIntType.INSTANCE, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, IntegerType.INSTANCE, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, BigIntType.INSTANCE, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, LargeIntType.INSTANCE, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, FloatType.INSTANCE, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, DoubleType.INSTANCE, false)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, DecimalV2Type.SYSTEM_DEFAULT, false)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, DecimalV3Type.SYSTEM_DEFAULT, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, DateType.INSTANCE, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, DateV2Type.INSTANCE, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, DateTimeType.INSTANCE, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, DateTimeV2Type.MAX, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, TimeV2Type.MAX, false)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, IPv4Type.INSTANCE, false)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, IPv6Type.INSTANCE, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, CharType.SYSTEM_DEFAULT, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, VarcharType.SYSTEM_DEFAULT, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, StringType.INSTANCE, false)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, JsonType.INSTANCE, false)); - Assertions.assertTrue(CheckCast.check(TimeV2Type.INSTANCE, VariantType.INSTANCE, false)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, ArrayType.SYSTEM_DEFAULT, false)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, MapType.SYSTEM_DEFAULT, false)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, StructType.SYSTEM_DEFAULT, false)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, HllType.INSTANCE, false)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, BitmapType.INSTANCE, false)); - Assertions.assertFalse(CheckCast.check(TimeV2Type.INSTANCE, QuantileStateType.INSTANCE, false)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, BooleanType.INSTANCE, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, TinyIntType.INSTANCE, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, SmallIntType.INSTANCE, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, BigIntType.INSTANCE, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, LargeIntType.INSTANCE, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, FloatType.INSTANCE, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, DoubleType.INSTANCE, false)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, DecimalV2Type.SYSTEM_DEFAULT, false)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, DecimalV3Type.SYSTEM_DEFAULT, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, DateType.INSTANCE, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, DateV2Type.INSTANCE, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, DateTimeType.INSTANCE, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.MAX, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, TimeV2Type.MAX, false)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, IPv4Type.INSTANCE, false)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, IPv6Type.INSTANCE, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, CharType.SYSTEM_DEFAULT, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, StringType.INSTANCE, false)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, JsonType.INSTANCE, false)); + Assertions.assertTrue(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, VariantType.INSTANCE, false)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, ArrayType.SYSTEM_DEFAULT, false)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, MapType.SYSTEM_DEFAULT, false)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, StructType.SYSTEM_DEFAULT, false)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, HllType.INSTANCE, false)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, BitmapType.INSTANCE, false)); + Assertions.assertFalse(CheckCast.check(TimeV2Type.SYSTEM_DEFAULT, QuantileStateType.INSTANCE, false)); } @Test diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/CastTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/CastTest.java index b7f377ce47b682..e078c252736bd3 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/CastTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/CastTest.java @@ -100,7 +100,7 @@ public void testCastFromTinyInt() { Assertions.assertTrue(cast.nullable()); cast = new Cast(child, DateTimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); - cast = new Cast(child, TimeV2Type.INSTANCE); + cast = new Cast(child, TimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); } } @@ -134,7 +134,7 @@ public void testCastFromSmallInt() { Assertions.assertTrue(cast.nullable()); cast = new Cast(child, DateTimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); - cast = new Cast(child, TimeV2Type.INSTANCE); + cast = new Cast(child, TimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); // To tinyint is always nullable @@ -172,7 +172,7 @@ public void testCastFromInteger() { Assertions.assertTrue(cast.nullable()); cast = new Cast(child, DateTimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); - cast = new Cast(child, TimeV2Type.INSTANCE); + cast = new Cast(child, TimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); // To tinyint and smallint is always nullable @@ -212,7 +212,7 @@ public void testCastFromBigInt() { Assertions.assertTrue(cast.nullable()); cast = new Cast(child, DateTimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); - cast = new Cast(child, TimeV2Type.INSTANCE); + cast = new Cast(child, TimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); // To tinyint, smallint and int is always nullable @@ -258,7 +258,7 @@ public void testCastFromLargeInt() { Assertions.assertTrue(cast.nullable()); cast = new Cast(child, DateTimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); - cast = new Cast(child, TimeV2Type.INSTANCE); + cast = new Cast(child, TimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); // To tinyint, smallint, int and bigint is always nullable @@ -297,7 +297,7 @@ public void testCastFromFloat() { Assertions.assertTrue(cast.nullable()); cast = new Cast(child, DateTimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); - cast = new Cast(child, TimeV2Type.INSTANCE); + cast = new Cast(child, TimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); // To integral and decimal is always nullable @@ -340,7 +340,7 @@ public void testCastFromDouble() { Assertions.assertTrue(cast.nullable()); cast = new Cast(child, DateTimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); - cast = new Cast(child, TimeV2Type.INSTANCE); + cast = new Cast(child, TimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); // To integral and decimal is always nullable @@ -423,7 +423,7 @@ public void testCastFromDecimal() { Assertions.assertTrue(cast.nullable()); cast = new Cast(child, DateTimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); - cast = new Cast(child, TimeV2Type.INSTANCE); + cast = new Cast(child, TimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); } } @@ -451,14 +451,14 @@ public void testCastFromTime() { try (MockedStatic mockedSessionVariable = Mockito.mockStatic(SessionVariable.class)) { // When strict mode is false mockedSessionVariable.when(SessionVariable::enableStrictCast).thenReturn(false); - SlotReference child = new SlotReference("slot", TimeV2Type.INSTANCE, false); + SlotReference child = new SlotReference("slot", TimeV2Type.SYSTEM_DEFAULT, false); Cast cast = new Cast(child, TinyIntType.INSTANCE); Assertions.assertTrue(cast.nullable()); cast = new Cast(child, SmallIntType.INSTANCE); Assertions.assertTrue(cast.nullable()); cast = new Cast(child, IntegerType.INSTANCE); Assertions.assertTrue(cast.nullable()); - cast = new Cast(child, TimeV2Type.INSTANCE); + cast = new Cast(child, TimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); } } @@ -493,7 +493,7 @@ public void testCastFromString() { Assertions.assertTrue(cast.nullable()); cast = new Cast(child, DateTimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); - cast = new Cast(child, TimeV2Type.INSTANCE); + cast = new Cast(child, TimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); cast = new Cast(child, IPv4Type.INSTANCE); Assertions.assertTrue(cast.nullable()); @@ -532,7 +532,7 @@ public void testCastFromChar() { Assertions.assertTrue(cast.nullable()); cast = new Cast(child, DateTimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); - cast = new Cast(child, TimeV2Type.INSTANCE); + cast = new Cast(child, TimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); cast = new Cast(child, IPv4Type.INSTANCE); Assertions.assertTrue(cast.nullable()); @@ -571,7 +571,7 @@ public void testCastFromVarchar() { Assertions.assertTrue(cast.nullable()); cast = new Cast(child, DateTimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); - cast = new Cast(child, TimeV2Type.INSTANCE); + cast = new Cast(child, TimeV2Type.SYSTEM_DEFAULT); Assertions.assertTrue(cast.nullable()); cast = new Cast(child, IPv4Type.INSTANCE); Assertions.assertTrue(cast.nullable()); diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/TryCastTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/TryCastTest.java index 092e083d722499..be7505ec137a32 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/TryCastTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/TryCastTest.java @@ -287,7 +287,7 @@ public void testTryCastFromTime() { try (MockedStatic mockedSessionVariable = Mockito.mockStatic(SessionVariable.class)) { // When strict mode is false mockedSessionVariable.when(SessionVariable::enableStrictCast).thenReturn(false); - SlotReference child = new SlotReference("slot", TimeV2Type.INSTANCE, false); + SlotReference child = new SlotReference("slot", TimeV2Type.SYSTEM_DEFAULT, false); TryCast cast = new TryCast(child, TinyIntType.INSTANCE); Assertions.assertTrue(cast.nullable()); Assertions.assertTrue(cast.parentNullable()); diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/functions/ComputeSignatureHelperTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/functions/ComputeSignatureHelperTest.java index 55d92d78df2b5c..6e206bb8dbd965 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/functions/ComputeSignatureHelperTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/functions/ComputeSignatureHelperTest.java @@ -421,8 +421,8 @@ void testMapDateTimeV2ComputePrecision() { @Test void testTimeV2PrecisionPromotion() { - FunctionSignature signature = FunctionSignature.ret(BooleanType.INSTANCE).args(TimeV2Type.INSTANCE, - TimeV2Type.INSTANCE, TimeV2Type.INSTANCE); + FunctionSignature signature = FunctionSignature.ret(BooleanType.INSTANCE).args(TimeV2Type.SYSTEM_DEFAULT, + TimeV2Type.SYSTEM_DEFAULT, TimeV2Type.SYSTEM_DEFAULT); List arguments = Lists.newArrayList(new TimeV2Literal("12:34:56.12"), new TimeV2Literal("12:34:56.123"), new TimeV2Literal("12:34:56.1")); signature = ComputeSignatureHelper.computePrecision(new FakeComputeSignature(), signature, arguments); @@ -436,7 +436,7 @@ void testTimeV2PrecisionPromotion() { @Test void testMixedDateTimeV2AndTimeV2PrecisionPromotion() { FunctionSignature signature = FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT).args( - DateTimeV2Type.SYSTEM_DEFAULT, TimeV2Type.INSTANCE, DateTimeV2Type.SYSTEM_DEFAULT); + DateTimeV2Type.SYSTEM_DEFAULT, TimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT); List arguments = Lists.newArrayList(new DateTimeV2Literal("2020-02-02 00:00:00.12"), new TimeV2Literal("12:34:56.123"), new DateTimeV2Literal("2020-02-02 00:00:00.1")); signature = ComputeSignatureHelper.computePrecision(new FakeComputeSignature(), signature, arguments); @@ -451,9 +451,9 @@ void testMixedDateTimeV2AndTimeV2PrecisionPromotion() { @Test void testNestedTimeV2PrecisionPromotion() { - FunctionSignature signature = FunctionSignature.ret(ArrayType.of(TimeV2Type.INSTANCE)).args( - ArrayType.of(TimeV2Type.INSTANCE), - MapType.of(IntegerType.INSTANCE, TimeV2Type.INSTANCE), TimeV2Type.INSTANCE); + FunctionSignature signature = FunctionSignature.ret(ArrayType.of(TimeV2Type.SYSTEM_DEFAULT)).args( + ArrayType.of(TimeV2Type.SYSTEM_DEFAULT), + MapType.of(IntegerType.INSTANCE, TimeV2Type.SYSTEM_DEFAULT), TimeV2Type.SYSTEM_DEFAULT); Map map = Maps.newLinkedHashMap(); map.put(new IntegerLiteral(1), new TimeV2Literal("12:34:56.1234")); List arguments = Lists.newArrayList( @@ -482,9 +482,9 @@ void testNestedTimeV2PrecisionPromotion() { void testComplexNestedMixedTimePrecisionPromotion() { // Create a complex nested structure with both DateTimeV2 and TimeV2 types FunctionSignature signature = FunctionSignature - .ret(MapType.of(DateTimeV2Type.SYSTEM_DEFAULT, ArrayType.of(TimeV2Type.INSTANCE))) - .args(MapType.of(DateTimeV2Type.SYSTEM_DEFAULT, ArrayType.of(TimeV2Type.INSTANCE)), - ArrayType.of(MapType.of(TimeV2Type.INSTANCE, + .ret(MapType.of(DateTimeV2Type.SYSTEM_DEFAULT, ArrayType.of(TimeV2Type.SYSTEM_DEFAULT))) + .args(MapType.of(DateTimeV2Type.SYSTEM_DEFAULT, ArrayType.of(TimeV2Type.SYSTEM_DEFAULT)), + ArrayType.of(MapType.of(TimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT)), DateTimeV2Type.SYSTEM_DEFAULT); diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/types/DataTypeTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/types/DataTypeTest.java index ccf1f9281c9335..3f5a4a4ca0f244 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/types/DataTypeTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/types/DataTypeTest.java @@ -113,7 +113,7 @@ void testConvertFromString() { // datev2 Assertions.assertEquals(DateV2Type.INSTANCE, DataType.convertFromString("datev2")); // time - Assertions.assertEquals(TimeV2Type.INSTANCE, DataType.convertFromString("time")); + Assertions.assertEquals(TimeV2Type.SYSTEM_DEFAULT, DataType.convertFromString("time")); // datetime Assertions.assertEquals(DateTimeType.INSTANCE, DataType.convertFromString("datetime")); diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionUtilsTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionUtilsTest.java index 65210025f7c20b..439216e63b3935 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionUtilsTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionUtilsTest.java @@ -311,7 +311,7 @@ public void testGetNumResultType() { // Hll type Assertions.assertEquals(DoubleType.INSTANCE, TypeCoercionUtils.getNumResultType(HllType.INSTANCE)); // Time type - Assertions.assertEquals(DoubleType.INSTANCE, TypeCoercionUtils.getNumResultType(TimeV2Type.INSTANCE)); + Assertions.assertEquals(DoubleType.INSTANCE, TypeCoercionUtils.getNumResultType(TimeV2Type.SYSTEM_DEFAULT)); // Json Assertions.assertEquals(DoubleType.INSTANCE, TypeCoercionUtils.getNumResultType(JsonType.INSTANCE)); // Other