-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[fix](nereids) fix parse date time exception #50810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix](nereids) fix parse date time exception #50810
Conversation
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
run buidall |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
run buildall |
run buildall |
TPC-H: Total hot run time: 33812 ms
|
TPC-DS: Total hot run time: 194200 ms
|
ClickBench: Total hot run time: 28.89 s
|
try { | ||
return Config.enable_date_conversion ? new DateV2Literal(value) : new DateLiteral(value); | ||
} catch (Exception e) { | ||
return new Cast(Literal.of(value), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Using "new StringLiteral(value)" is more explicit than "Literal.of(value)".
- why not handle this pattern on FE side? if we do it on fe side, it is good for const-fold and some other expression rewrite rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- fix;
- be can handle many pattern of date time, including fault tolerance cases, and fe can handle only some of them, if fe cannot handle, it will parse to be
PR approved by at least one committer and no changes requested. |
run buildall |
TPC-H: Total hot run time: 35046 ms
|
TPC-DS: Total hot run time: 193855 ms
|
ClickBench: Total hot run time: 28.88 s
|
PR approved by at least one committer and no changes requested. |
### What problem does this PR solve? before this pr: ``` MySQL root@127.0.0.1:(none)> select date '2025年1月20日'; (1105, 'errCode = 2, detailMessage = date/datetime literal [2025年1月20日] is invalid') ``` after this pr: ``` MySQL root@127.0.0.1:(none)> select date '2025年1月20日'; +----------------------+ | date '2025年1月20日' | +----------------------+ | 2025-01-20 | +----------------------+ ```
### What problem does this PR solve? before this pr: ``` MySQL root@127.0.0.1:(none)> select date '2025年1月20日'; (1105, 'errCode = 2, detailMessage = date/datetime literal [2025年1月20日] is invalid') ``` after this pr: ``` MySQL root@127.0.0.1:(none)> select date '2025年1月20日'; +----------------------+ | date '2025年1月20日' | +----------------------+ | 2025-01-20 | +----------------------+ ```
What problem does this PR solve?
before this pr:
after this pr:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)