[date](fix) modify push-down predicate for datev1 type (#25571)

For comparison predicate, two arguments must be cast to datetime and push down to storage if either one is date type. This PR disables predicate push-down for this case.
This commit is contained in:
Gabriel
2023-10-19 14:18:27 +08:00
committed by GitHub
parent ed713c2e2d
commit 3d1206d325
6 changed files with 0 additions and 47 deletions

View File

@ -188,16 +188,6 @@ public class SimplifyComparisonPredicate extends AbstractExpressionRewriteRule {
}
}
if (left.getDataType() == DateType.INSTANCE && right.getDataType() == DateType.INSTANCE) {
// Date cp Date is not supported in BE storage engine. So cast to DateTime
left = new Cast(left, DateTimeType.INSTANCE);
if (right instanceof DateLiteral) {
DateLiteral l = (DateLiteral) right;
right = new DateTimeLiteral(l.getYear(), l.getMonth(), l.getDay(), 0, 0, 0);
} else {
right = new Cast(right, DateTimeType.INSTANCE);
}
}
if (left != cp.left() || right != cp.right()) {
return cp.withChildren(left, right);
} else {