-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](Nereids) fix str_to_date date value out of range #49033
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
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-H: Total hot run time: 32372 ms |
TPC-DS: Total hot run time: 186662 ms |
ClickBench: Total hot run time: 30.74 s |
| .hasMicroSecondPart(format.getStringValue()); | ||
| return DateTimeV2Literal.fromJavaDateType(DateUtils.getTime(DateUtils.formatBuilder(format.getValue()) | ||
| .toFormatter(), str.getValue()), hasMicroPart ? 6 : 0); | ||
| .toFormatter().withResolverStyle(ResolverStyle.STRICT), str.getValue()), hasMicroPart ? 6 : 0); |
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.
could we refactor formatBuilder lightly to avoid call .toFormatter().withResolverStyle(ResolverStyle.STRICT) too many times in different place
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.
toFormatter is one of DateTimeFormatterBuilder.java functions, which is not easy to refactor. And we use it a lot, it may cause a wide range of affection
39bc87e to
7198191
Compare
|
run buildall |
TPC-H: Total hot run time: 32276 ms |
TPC-DS: Total hot run time: 191584 ms |
ClickBench: Total hot run time: 31.54 s |
...apache/doris/nereids/trees/expressions/functions/executable/DateTimeExtractAndTransform.java
Outdated
Show resolved
Hide resolved
...apache/doris/nereids/trees/expressions/functions/executable/DateTimeExtractAndTransform.java
Outdated
Show resolved
Hide resolved
...apache/doris/nereids/trees/expressions/functions/executable/DateTimeExtractAndTransform.java
Outdated
Show resolved
Hide resolved
...apache/doris/nereids/trees/expressions/functions/executable/DateTimeExtractAndTransform.java
Outdated
Show resolved
Hide resolved
|
run buildall |
TPC-H: Total hot run time: 32930 ms |
TPC-DS: Total hot run time: 186534 ms |
ClickBench: Total hot run time: 31.09 s |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
… range (apache#49033) Related PR: apache#18209 Problem Summary: SELECT STR_TO_DATE('2025-04-31', '%Y-%m-%d') AS result; would be changed to result 2025-04-30 in smart mode by mistake
… range (apache#49033) Related PR: apache#18209 Problem Summary: SELECT STR_TO_DATE('2025-04-31', '%Y-%m-%d') AS result; would be changed to result 2025-04-30 in smart mode by mistake
… range (apache#49033) Related PR: apache#18209 Problem Summary: SELECT STR_TO_DATE('2025-04-31', '%Y-%m-%d') AS result; would be changed to result 2025-04-30 in smart mode by mistake
… range (apache#49033) Related PR: apache#18209 Problem Summary: SELECT STR_TO_DATE('2025-04-31', '%Y-%m-%d') AS result; would be changed to result 2025-04-30 in smart mode by mistake
… range (apache#49033) Related PR: apache#18209 Problem Summary: SELECT STR_TO_DATE('2025-04-31', '%Y-%m-%d') AS result; would be changed to result 2025-04-30 in smart mode by mistake
… range (apache#49033) Related PR: apache#18209 Problem Summary: SELECT STR_TO_DATE('2025-04-31', '%Y-%m-%d') AS result; would be changed to result 2025-04-30 in smart mode by mistake
… range (apache#49033) ### What problem does this PR solve? Related PR: apache#18209 Problem Summary: SELECT STR_TO_DATE('2025-04-31', '%Y-%m-%d') AS result; would be changed to result 2025-04-30 in smart mode by mistake
What problem does this PR solve?
Related PR: #18209
Problem Summary:
SELECT STR_TO_DATE('2025-04-31', '%Y-%m-%d') AS result;
would be changed to result 2025-04-30 in smart mode by mistake
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)