[fix](datatype) fixed decimal type implicit cast handling in BinaryPredicate (#30181)
This commit is contained in:
@ -1674,10 +1674,19 @@ public abstract class Expr extends TreeNode<Expr> implements ParseNode, Cloneabl
|
||||
Type t2 = getChild(1).getType();
|
||||
// add operand casts
|
||||
Preconditions.checkState(compatibleType.isValid());
|
||||
if (t1.getPrimitiveType() != compatibleType.getPrimitiveType()) {
|
||||
if (t1.isDecimalV3() || t1.isDecimalV2()) {
|
||||
if (!t1.equals(compatibleType)) {
|
||||
castChild(compatibleType, 0);
|
||||
}
|
||||
} else if (t1.getPrimitiveType() != compatibleType.getPrimitiveType()) {
|
||||
castChild(compatibleType, 0);
|
||||
}
|
||||
if (t2.getPrimitiveType() != compatibleType.getPrimitiveType()) {
|
||||
|
||||
if (t2.isDecimalV3() || t2.isDecimalV2()) {
|
||||
if (!t2.equals(compatibleType)) {
|
||||
castChild(compatibleType, 1);
|
||||
}
|
||||
} else if (t2.getPrimitiveType() != compatibleType.getPrimitiveType()) {
|
||||
castChild(compatibleType, 1);
|
||||
}
|
||||
return compatibleType;
|
||||
|
||||
Reference in New Issue
Block a user