Skip to content

Commit

Permalink
[fix](nereids)fix some function signature issue (apache#25301)
Browse files Browse the repository at this point in the history
1. remove wrong signature of nvl
2. the promoted type datetimev2 for datetime should be datetimev2(0)
  • Loading branch information
starocean999 authored Oct 12, 2023
1 parent a0d3206 commit 80a49ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 80a49ed

Please sign in to comment.