-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 str_to_date date value out of range #49033
base: master
Are you sure you want to change the base?
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
|
@@ -631,19 +636,19 @@ public static Expression strToDate(StringLikeLiteral str, StringLikeLiteral form | |||
boolean hasMicroPart = org.apache.doris.analysis.DateLiteral | |||
.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
|
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
SELECT STR_TO_DATE('2025-04-31', '%Y-%m-%d') AS result; would be changed to result 2025-04-30 in smart mode
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)