[fix](Nereids) decimal compare float should use double as common type (#19710)

This commit is contained in:
Zhang Wenxin
2023-05-17 10:36:04 +08:00
committed by GitHub
parent d784c99360
commit c98147375d

View File

@ -939,6 +939,10 @@ public class TypeCoercionUtils {
}
// numeric
if (leftType.isFloatType() || leftType.isDoubleType()
|| rightType.isFloatType() || rightType.isDoubleType()) {
return Optional.of(DoubleType.INSTANCE);
}
if (leftType.isNumericType() && rightType.isNumericType()) {
DataType commonType = leftType;
for (DataType dataType : NUMERIC_PRECEDENCE) {