[fix](Nereids) decimalv2 and int/date bit arithmetic need cast to bigint (#32311)
This commit is contained in:
@ -798,12 +798,6 @@ public class TypeCoercionUtils {
|
||||
commonType = DoubleType.INSTANCE;
|
||||
}
|
||||
|
||||
// we treat decimalv2 vs dicimalv3, largeint or bigint as decimalv3 way.
|
||||
if ((t1.isDecimalV3Type() || t1.isBigIntType() || t1.isLargeIntType()) && t2.isDecimalV2Type()
|
||||
|| t1.isDecimalV2Type() && (t2.isDecimalV3Type() || t2.isBigIntType() || t2.isLargeIntType())) {
|
||||
return processDecimalV3BinaryArithmetic(binaryArithmetic, left, right);
|
||||
}
|
||||
|
||||
if (t1.isDecimalV2Type() || t2.isDecimalV2Type()) {
|
||||
// to be consistent with old planner
|
||||
// see findCommonType() method in ArithmeticExpr.java
|
||||
@ -832,6 +826,12 @@ public class TypeCoercionUtils {
|
||||
return binaryArithmetic;
|
||||
}
|
||||
|
||||
// we treat decimalv2 vs dicimalv3, largeint or bigint as decimalv3 way.
|
||||
if ((t1.isDecimalV3Type() || t1.isBigIntType() || t1.isLargeIntType()) && t2.isDecimalV2Type()
|
||||
|| t1.isDecimalV2Type() && (t2.isDecimalV3Type() || t2.isBigIntType() || t2.isLargeIntType())) {
|
||||
return processDecimalV3BinaryArithmetic(binaryArithmetic, left, right);
|
||||
}
|
||||
|
||||
// if double as common type, all arithmetic should cast both side to double
|
||||
if (isArithmetic && commonType.isDoubleType()) {
|
||||
return castChildren(binaryArithmetic, left, right, commonType);
|
||||
|
||||
Reference in New Issue
Block a user