[fix](planner) fix bugs in uncheckedCastChild (#15905)
1. `uncheckedCastChild` may generate redundant `CastExpr` like `cast( cast(XXX as Date) as Date)` 2. generate DateLiteral to replace cast(IntLiteral as Date)
This commit is contained in:
@ -283,6 +283,13 @@ public abstract class Type {
|
||||
return isScalarType(PrimitiveType.DATETIMEV2);
|
||||
}
|
||||
|
||||
public boolean isDateLike() {
|
||||
return isScalarType(PrimitiveType.DATETIME)
|
||||
|| isScalarType(PrimitiveType.DATETIMEV2)
|
||||
|| isScalarType(PrimitiveType.DATE)
|
||||
|| isScalarType(PrimitiveType.DATEV2);
|
||||
}
|
||||
|
||||
public boolean isTimeV2() {
|
||||
return isScalarType(PrimitiveType.TIMEV2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user