-
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
[MERGE-ATTN](function) fix str_to_date default return type scale for nereids #24932
Conversation
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
(From new machine)TeamCity pipeline, clickbench performance test result: |
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TeamCity be ut coverage result: |
(From new machine)TeamCity pipeline, clickbench performance test result: |
55ddb1f
to
537e097
Compare
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
(From new machine)TeamCity pipeline, clickbench performance test result: |
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TeamCity be ut coverage result: |
(From new machine)TeamCity pipeline, clickbench performance test result: |
11f6b7e
to
115e784
Compare
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TeamCity be ut coverage result: |
(From new machine)TeamCity pipeline, clickbench performance test result: |
run buildall |
TeamCity be ut coverage result: |
(From new machine)TeamCity pipeline, clickbench performance test result: |
115e784
to
5e85887
Compare
run buildall |
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.
clang-tidy made some suggestions
5e85887
to
ec430d7
Compare
run buildall |
TeamCity be ut coverage result: |
(From new machine)TeamCity pipeline, clickbench performance test result: |
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.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
…#24932) fix str_to_date default return type scale for nereids
…apache#24932) fix str_to_date default return type scale for nereids
…apache#24932) fix str_to_date default return type scale for nereids
…d issue (#47129) ### What problem does this PR solve? Issue Number: close #47105 Related PR: #24932 Problem Summary: ### Release note str_to_date always return microsecond part for datetime even if user does not specfic %f in date format string. This is wrong. mysql> select id,str_to_date(dt, '%Y-%m-%d %H:%i:%s') from test1 limit 1; +------+--------------------------------------+ | id | str_to_date(dt, '%Y-%m-%d %H:%i:%s') | +------+--------------------------------------+ | 2 | 2024-12-28 10:11:12.000000 | +------+--------------------------------------+ and constant fold scenario is wrong too: mysql> select cast(str_to_date('2025-01-17 11:59:30', '%Y-%m-%d %H:%i:%s') as string); +--------------------------------------------------------------------------+ | cast(str_to_date('2025-01-17 11:59:30', '%Y-%m-%d %H:%i:%s') as TEXT) | +--------------------------------------------------------------------------+ | 2025-01-17 11:59:30.000000 | +--------------------------------------------------------------------------+ ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [x] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [x] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [x] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
…d issue (#47129) ### What problem does this PR solve? Issue Number: close #47105 Related PR: #24932 Problem Summary: ### Release note str_to_date always return microsecond part for datetime even if user does not specfic %f in date format string. This is wrong. mysql> select id,str_to_date(dt, '%Y-%m-%d %H:%i:%s') from test1 limit 1; +------+--------------------------------------+ | id | str_to_date(dt, '%Y-%m-%d %H:%i:%s') | +------+--------------------------------------+ | 2 | 2024-12-28 10:11:12.000000 | +------+--------------------------------------+ and constant fold scenario is wrong too: mysql> select cast(str_to_date('2025-01-17 11:59:30', '%Y-%m-%d %H:%i:%s') as string); +--------------------------------------------------------------------------+ | cast(str_to_date('2025-01-17 11:59:30', '%Y-%m-%d %H:%i:%s') as TEXT) | +--------------------------------------------------------------------------+ | 2025-01-17 11:59:30.000000 | +--------------------------------------------------------------------------+ ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [x] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [x] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [x] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
…d issue (#47129) ### What problem does this PR solve? Issue Number: close #47105 Related PR: #24932 Problem Summary: ### Release note str_to_date always return microsecond part for datetime even if user does not specfic %f in date format string. This is wrong. mysql> select id,str_to_date(dt, '%Y-%m-%d %H:%i:%s') from test1 limit 1; +------+--------------------------------------+ | id | str_to_date(dt, '%Y-%m-%d %H:%i:%s') | +------+--------------------------------------+ | 2 | 2024-12-28 10:11:12.000000 | +------+--------------------------------------+ and constant fold scenario is wrong too: mysql> select cast(str_to_date('2025-01-17 11:59:30', '%Y-%m-%d %H:%i:%s') as string); +--------------------------------------------------------------------------+ | cast(str_to_date('2025-01-17 11:59:30', '%Y-%m-%d %H:%i:%s') as TEXT) | +--------------------------------------------------------------------------+ | 2025-01-17 11:59:30.000000 | +--------------------------------------------------------------------------+ ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [x] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [x] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [x] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
…d issue (apache#47129) ### What problem does this PR solve? Issue Number: close apache#47105 Related PR: apache#24932 Problem Summary: ### Release note str_to_date always return microsecond part for datetime even if user does not specfic %f in date format string. This is wrong. mysql> select id,str_to_date(dt, '%Y-%m-%d %H:%i:%s') from test1 limit 1; +------+--------------------------------------+ | id | str_to_date(dt, '%Y-%m-%d %H:%i:%s') | +------+--------------------------------------+ | 2 | 2024-12-28 10:11:12.000000 | +------+--------------------------------------+ and constant fold scenario is wrong too: mysql> select cast(str_to_date('2025-01-17 11:59:30', '%Y-%m-%d %H:%i:%s') as string); +--------------------------------------------------------------------------+ | cast(str_to_date('2025-01-17 11:59:30', '%Y-%m-%d %H:%i:%s') as TEXT) | +--------------------------------------------------------------------------+ | 2025-01-17 11:59:30.000000 | +--------------------------------------------------------------------------+ ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [x] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [x] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [x] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
If merge this pr into other branch, must together with #25707
Proposed changes
Issue Number: close #xxx
when we have return type of DatetimeV2, will set its' scale to MAX, which is 6.
btw, fix the wrong result of format string parsing when there's
%f
and also other things trailing.Further comments
If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...