[enhance](nereids) tightestCommonType of datetime and datev2 is datev2 (#16086)

in original planner, tightestCommonType of datetime and datev2 is datev2.
make nereids compatible with original planner.
This commit is contained in:
minghong
2023-01-19 19:55:19 +08:00
committed by GitHub
parent 6cff651f71
commit 379ba73675

View File

@ -234,10 +234,10 @@ public class TypeCoercionUtils {
tightestCommonType = left;
} else if (right instanceof DateTimeV2Type) {
tightestCommonType = right;
} else if (left instanceof DateTimeType || right instanceof DateTimeType) {
tightestCommonType = DateTimeType.INSTANCE;
} else if (left instanceof DateV2Type || right instanceof DateV2Type) {
tightestCommonType = DateV2Type.INSTANCE;
} else if (left instanceof DateTimeType || right instanceof DateTimeType) {
tightestCommonType = DateTimeType.INSTANCE;
}
} else if (left instanceof DoubleType && right instanceof DecimalV2Type
|| left instanceof DecimalV2Type && right instanceof DoubleType) {