Add the unchecked cast from date literal to others (#2021)
Fix the ISSUE:2017 This commit enable the cast function in date. The date literal can be cast to target type which is implicitly castable such as int, bigint, largeint.
This commit is contained in:
@ -313,6 +313,8 @@ public class DateLiteral extends LiteralExpr {
|
||||
return this;
|
||||
} else if (targetType.isStringType()) {
|
||||
return new StringLiteral(getStringValue());
|
||||
} else if (Type.isImplicitlyCastable(this.type, targetType, true)) {
|
||||
return new CastExpr(targetType, this);
|
||||
}
|
||||
Preconditions.checkState(false);
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user