Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #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'`.
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Dec 23, 2024
@hello-stephen
Copy link
Contributor

run buildall

@yujun777
Copy link
Contributor

run p0

1 similar comment
@yujun777
Copy link
Contributor

run p0

@englefly englefly merged commit 412355b into branch-2.1 Dec 23, 2024
18 of 19 checks passed
@github-actions github-actions bot deleted the auto-pick-45735-branch-2.1 branch December 23, 2024 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants