[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)
This commit is contained in:
starocean999
2023-10-12 14:23:20 +08:00
committed by GitHub
parent a0d3206d78
commit 80a49ed97a
2 changed files with 2 additions and 3 deletions

View File

@ -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)

View File

@ -72,7 +72,8 @@ public class DateTimeV2Type extends DateLikeType {
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;