[Fix](nereids) fix date function rewrite (#32060)

This commit is contained in:
feiniaofeiafei
2024-03-12 17:49:49 +08:00
committed by yiguolei
parent 6610307eb0
commit 781a45d93c
3 changed files with 36 additions and 2 deletions

View File

@ -77,14 +77,14 @@ public class DateFunctionRewrite extends AbstractExpressionRewriteRule {
if (greaterThan.left().child(0).getDataType() instanceof DateTimeType
&& greaterThan.right() instanceof DateLiteral) {
DateTimeLiteral newLiteral = ((DateLiteral) greaterThan.right()).toBeginOfTomorrow();
return new GreaterThan(greaterThan.left().child(0), newLiteral);
return new GreaterThanEqual(greaterThan.left().child(0), newLiteral);
}
// V2
if (greaterThan.left().child(0).getDataType() instanceof DateTimeV2Type
&& greaterThan.right() instanceof DateV2Literal) {
DateTimeV2Literal newLiteral = ((DateV2Literal) greaterThan.right()).toBeginOfTomorrow();
return new GreaterThan(greaterThan.left().child(0), newLiteral);
return new GreaterThanEqual(greaterThan.left().child(0), newLiteral);
}
}