You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[fix](nereids) fix comparison with date like (#45735)
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #45382
Problem Summary:
#45382 had fix compare date/datev1 with datetime literal wrong cutting.
but it not fix completely.
```
if (right instanceof DateTimeLiteral) {
DateTimeLiteral dateTimeLiteral = (DateTimeLiteral) right;
right = migrateToDateV2(dateTimeLiteral);
if (dateTimeLiteral.getHour() != 0 || dateTimeLiteral.getMinute() != 0
|| dateTimeLiteral.getSecond() != 0) {
...
}
}
```
For the above code, if check right is date time literal, but notice that
datetimev2 literal is datetime literal's child class. so datetimev2
literal will also run the above code. And datetimev2 literal should
check its microseconds not equals to 0.
for example: `date_a = '2020-01-01 00:00:00.01'` should opt as `FALSE`,
but not `date_a = '2020-01-01'`.
Copy file name to clipboardExpand all lines: fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/rules/SimplifyComparisonPredicateTest.java
0 commit comments