[fix](planner) decimalv2 castTo decimalv2 should change type directly (#18297)

This commit is contained in:
morrySnow
2023-04-06 13:51:50 +08:00
committed by GitHub
parent 8b61709ec8
commit db766bb073
3 changed files with 88 additions and 0 deletions

View File

@ -1435,6 +1435,13 @@ public abstract class Expr extends TreeNode<Expr> implements ParseNode, Cloneabl
&& (this.type.isStringType() || this.type.isHllType())) {
return this;
}
if (targetType.getPrimitiveType() == PrimitiveType.DECIMALV2
&& this.type.getPrimitiveType() == PrimitiveType.DECIMALV2) {
this.type = targetType;
return this;
}
// Preconditions.checkState(PrimitiveType.isImplicitCast(type, targetType),
// "cast %s to %s", this.type, targetType);
// TODO(zc): use implicit cast