Skip to content

[Fix](datetime) fix %f (microseconds) format specifier in str_to_date#60632

Merged
zclllyybb merged 1 commit intoapache:masterfrom
zclllyybb:str_to_date
Feb 10, 2026
Merged

[Fix](datetime) fix %f (microseconds) format specifier in str_to_date#60632
zclllyybb merged 1 commit intoapache:masterfrom
zclllyybb:str_to_date

Conversation

@zclllyybb
Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

before it returns NULL, now is:

select str_to_date('2026-01-28 11:32:47.123', '%Y-%m-%d %T.%f');
+----------------------------------------------------------+
| str_to_date('2026-01-28 11:32:47.123', '%Y-%m-%d %T.%f') |
+----------------------------------------------------------+
| 2026-01-28 11:32:47.123000                               |
+----------------------------------------------------------+

Release note

None

Check List (For Author)

  • Test

    • 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
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen
Copy link
Copy Markdown
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?

@zclllyybb
Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot
Copy link
Copy Markdown

TPC-H: Total hot run time: 30535 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 641ddd4c646ac77d93a2fba59956405d6af83792, data reload: false

------ Round 1 ----------------------------------
q1	17641	4450	4311	4311
q2	2038	384	234	234
q3	10102	1332	754	754
q4	10199	793	310	310
q5	7514	2217	1893	1893
q6	205	185	147	147
q7	878	766	601	601
q8	9266	1384	1188	1188
q9	4733	4719	4577	4577
q10	6792	1933	1546	1546
q11	541	310	289	289
q12	343	389	227	227
q13	17787	4088	3210	3210
q14	238	246	216	216
q15	858	810	815	810
q16	676	718	625	625
q17	682	820	541	541
q18	6402	5767	6098	5767
q19	1274	1110	658	658
q20	591	540	414	414
q21	2779	2038	1922	1922
q22	405	344	295	295
Total cold run time: 101944 ms
Total hot run time: 30535 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4571	4579	4667	4579
q2	257	361	242	242
q3	2380	2877	2592	2592
q4	1437	1845	1417	1417
q5	4716	4677	4515	4515
q6	227	176	149	149
q7	1934	1858	1930	1858
q8	2547	2416	2433	2416
q9	7575	7460	7439	7439
q10	2923	3149	2640	2640
q11	563	469	450	450
q12	707	745	608	608
q13	3967	4318	3552	3552
q14	309	316	279	279
q15	856	831	818	818
q16	665	750	683	683
q17	1153	1270	1288	1270
q18	7512	7371	7531	7371
q19	845	808	814	808
q20	1938	2024	1889	1889
q21	4469	4342	4129	4129
q22	568	542	500	500
Total cold run time: 52119 ms
Total hot run time: 50204 ms

@doris-robot
Copy link
Copy Markdown

ClickBench: Total hot run time: 28.58 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 641ddd4c646ac77d93a2fba59956405d6af83792, data reload: false

query1	0.05	0.05	0.04
query2	0.10	0.05	0.05
query3	0.27	0.09	0.08
query4	1.61	0.11	0.11
query5	0.28	0.25	0.25
query6	1.16	0.67	0.67
query7	0.03	0.02	0.03
query8	0.05	0.04	0.04
query9	0.56	0.51	0.50
query10	0.56	0.55	0.55
query11	0.14	0.09	0.10
query12	0.14	0.11	0.11
query13	0.63	0.61	0.61
query14	1.08	1.08	1.05
query15	0.87	0.88	0.88
query16	0.40	0.39	0.40
query17	1.20	1.14	1.11
query18	0.23	0.20	0.21
query19	2.12	1.96	2.09
query20	0.02	0.01	0.01
query21	15.43	0.24	0.15
query22	5.02	0.06	0.05
query23	15.78	0.29	0.11
query24	1.41	0.45	0.45
query25	0.08	0.05	0.06
query26	0.15	0.14	0.15
query27	0.06	0.06	0.06
query28	4.19	1.14	0.97
query29	12.54	3.94	3.13
query30	0.27	0.14	0.11
query31	2.82	0.65	0.40
query32	3.24	0.60	0.51
query33	3.22	3.28	3.27
query34	16.20	5.45	4.77
query35	4.78	4.82	4.85
query36	0.65	0.49	0.49
query37	0.11	0.07	0.07
query38	0.08	0.04	0.04
query39	0.05	0.04	0.03
query40	0.20	0.17	0.16
query41	0.09	0.04	0.03
query42	0.04	0.03	0.02
query43	0.04	0.03	0.04
Total cold run time: 97.95 s
Total hot run time: 28.58 s

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 50.00% (2/4) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link
Copy Markdown

BE UT Coverage Report

Increment line coverage 66.67% (4/6) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.72% (19446/36882)
Line Coverage 36.23% (181136/499903)
Region Coverage 32.63% (140711/431171)
Branch Coverage 33.63% (60886/181053)

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 66.67% (4/6) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 57.27% (20696/36138)
Line Coverage 40.26% (200744/498665)
Region Coverage 36.93% (160862/435553)
Branch Coverage 37.68% (68495/181757)

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 50.00% (2/4) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 66.67% (4/6) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 57.27% (20696/36138)
Line Coverage 40.26% (200744/498665)
Region Coverage 36.93% (160862/435553)
Branch Coverage 37.68% (68495/181757)

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 50.00% (2/4) 🎉
Increment coverage report
Complete coverage report

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Feb 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@zclllyybb zclllyybb merged commit f6af3e8 into apache:master Feb 10, 2026
31 of 33 checks passed
@zclllyybb zclllyybb deleted the str_to_date branch February 10, 2026 07:25
github-actions bot pushed a commit that referenced this pull request Feb 10, 2026
…#60632)

before it returns `NULL`, now is:
```sql
select str_to_date('2026-01-28 11:32:47.123', '%Y-%m-%d %T.%f');
+----------------------------------------------------------+
| str_to_date('2026-01-28 11:32:47.123', '%Y-%m-%d %T.%f') |
+----------------------------------------------------------+
| 2026-01-28 11:32:47.123000                               |
+----------------------------------------------------------+
```
yiguolei pushed a commit that referenced this pull request Feb 10, 2026
… str_to_date #60632 (#60642)

Cherry-picked from #60632

Co-authored-by: zclllyybb <zhaochangle@selectdb.com>
ybtsdst pushed a commit to ybtsdst/doris that referenced this pull request Feb 27, 2026
… str_to_date apache#60632 (apache#60642)

Cherry-picked from apache#60632

Co-authored-by: zclllyybb <zhaochangle@selectdb.com>
@yiguolei yiguolei mentioned this pull request Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/4.0.4-merged p0_w reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants