From 80a49ed97a29f6b6488c739981dd3b09531d33ac Mon Sep 17 00:00:00 2001 From: starocean999 <40539150+starocean999@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:23:20 +0800 Subject: [PATCH] [fix](nereids)fix some function signature issue (#25301) 1. remove wrong signature of nvl 2. the promoted type datetimev2 for datetime should be datetimev2(0) --- .../doris/nereids/trees/expressions/functions/scalar/Nvl.java | 2 -- .../java/org/apache/doris/nereids/types/DateTimeV2Type.java | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Nvl.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Nvl.java index 945feec9d2ed26..9b8e51d238d061 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Nvl.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Nvl.java @@ -62,8 +62,6 @@ public class Nvl extends ScalarFunction FunctionSignature.ret(FloatType.INSTANCE).args(FloatType.INSTANCE, FloatType.INSTANCE), FunctionSignature.ret(DateType.INSTANCE).args(DateType.INSTANCE, DateType.INSTANCE), FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, DateTimeType.INSTANCE), - FunctionSignature.ret(DateTimeType.INSTANCE).args(DateType.INSTANCE, DateTimeType.INSTANCE), - FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, DateType.INSTANCE), FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT) .args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT), FunctionSignature.ret(DateV2Type.INSTANCE) 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 0aadd376dfd590..f312d6bc7cba25 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 @@ -72,7 +72,8 @@ public static DateTimeV2Type forType(DataType dataType) { if (dataType instanceof DateTimeV2Type) { return (DateTimeV2Type) dataType; } - if (dataType instanceof IntegralType || dataType instanceof BooleanType || dataType instanceof NullType) { + if (dataType instanceof IntegralType || dataType instanceof BooleanType + || dataType instanceof NullType || dataType instanceof DateTimeType) { return SYSTEM_DEFAULT; } return MAX;