Skip to content
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](function) Fix wrong FE fold constant implementation of function date_format #49032

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zclllyybb
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

before, the FE fold impl is wrong for format string %h, %I, %l, %r in sometime.

Release note

Fix wrong constant folding result of function date_format in sometime.

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

@zclllyybb
Copy link
Contributor Author

run buildall

@Thearas
Copy link
Contributor

Thearas commented Mar 13, 2025

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?

@morrySnow morrySnow added usercase Important user case type label p0_w dev/2.1.x dev/3.0.x labels Mar 13, 2025
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 13, 2025
Copy link
Contributor

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

Copy link
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17650	5269	5137	5137
q2	2090	1345	1185	1185
q3	10390	1307	689	689
q4	10274	1038	543	543
q5	8555	2434	2392	2392
q6	220	169	134	134
q7	932	747	624	624
q8	9329	1302	1067	1067
q9	5005	4802	4921	4802
q10	6811	2318	1897	1897
q11	471	275	260	260
q12	349	366	221	221
q13	17788	3733	3103	3103
q14	228	232	215	215
q15	537	486	476	476
q16	653	621	599	599
q17	572	890	343	343
q18	6918	6499	6360	6360
q19	1473	965	568	568
q20	323	322	192	192
q21	2881	2229	1986	1986
q22	1062	1021	985	985
Total cold run time: 104511 ms
Total hot run time: 33778 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5216	5174	5188	5174
q2	244	332	229	229
q3	2154	2671	2318	2318
q4	1512	1850	1381	1381
q5	4280	4137	4389	4137
q6	220	184	140	140
q7	2005	1955	1800	1800
q8	2641	2648	2598	2598
q9	7032	7221	7125	7125
q10	2991	3196	2784	2784
q11	584	517	484	484
q12	729	771	595	595
q13	3565	3960	3376	3376
q14	311	318	271	271
q15	546	494	477	477
q16	666	711	646	646
q17	1155	1604	1391	1391
q18	7763	7693	7383	7383
q19	825	844	940	844
q20	1950	2053	1919	1919
q21	5545	5039	4910	4910
q22	1088	1090	1067	1067
Total cold run time: 53022 ms
Total hot run time: 51049 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 192319 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 6a83645c0f5b48fbb9b56b70015f8ac4d0729956, data reload: false

query1	1425	1061	994	994
query2	6061	1927	1888	1888
query3	11117	4664	4665	4664
query4	58182	25355	23202	23202
query5	4922	531	480	480
query6	406	189	188	188
query7	5028	516	286	286
query8	325	260	232	232
query9	7085	2621	2625	2621
query10	428	338	265	265
query11	15247	15110	15040	15040
query12	176	110	105	105
query13	1200	542	420	420
query14	10751	7025	6999	6999
query15	226	214	184	184
query16	7151	696	501	501
query17	1054	766	598	598
query18	1605	431	348	348
query19	200	192	168	168
query20	124	121	124	121
query21	209	130	120	120
query22	4704	4524	4491	4491
query23	34163	33190	33647	33190
query24	5716	2427	2434	2427
query25	471	460	405	405
query26	691	275	162	162
query27	1732	502	335	335
query28	2862	2428	2439	2428
query29	578	577	442	442
query30	272	230	199	199
query31	899	851	802	802
query32	72	61	69	61
query33	468	363	311	311
query34	783	848	511	511
query35	813	907	754	754
query36	968	1081	931	931
query37	126	109	79	79
query38	4273	4139	4078	4078
query39	1497	1456	1458	1456
query40	207	122	101	101
query41	53	49	48	48
query42	128	109	115	109
query43	522	524	482	482
query44	1373	813	818	813
query45	191	186	165	165
query46	871	1060	667	667
query47	1751	1797	1693	1693
query48	406	428	301	301
query49	702	516	419	419
query50	725	749	414	414
query51	4170	4205	4087	4087
query52	110	103	97	97
query53	226	275	187	187
query54	481	499	419	419
query55	86	86	78	78
query56	270	257	256	256
query57	1111	1126	1055	1055
query58	239	242	244	242
query59	2754	2754	2476	2476
query60	284	266	259	259
query61	124	124	162	124
query62	727	765	653	653
query63	225	188	198	188
query64	1779	1064	699	699
query65	4419	4336	4318	4318
query66	734	405	295	295
query67	15871	15520	15314	15314
query68	7629	881	504	504
query69	558	309	262	262
query70	1265	1154	1134	1134
query71	518	300	269	269
query72	5455	3661	3870	3661
query73	1308	761	349	349
query74	9053	9231	8918	8918
query75	3813	3148	2668	2668
query76	4426	1211	748	748
query77	622	364	281	281
query78	10118	10185	9337	9337
query79	2234	836	592	592
query80	620	558	437	437
query81	473	265	220	220
query82	693	130	99	99
query83	173	176	149	149
query84	284	93	72	72
query85	791	359	315	315
query86	375	314	287	287
query87	4509	4490	4434	4434
query88	3424	2279	2268	2268
query89	421	324	276	276
query90	1904	241	215	215
query91	139	140	106	106
query92	68	58	57	57
query93	1600	1058	582	582
query94	715	426	311	311
query95	348	273	266	266
query96	480	622	273	273
query97	3322	3410	3284	3284
query98	227	204	206	204
query99	1635	1367	1296	1296
Total cold run time: 303749 ms
Total hot run time: 192319 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.07	0.03	0.03
query3	0.23	0.06	0.06
query4	1.62	0.10	0.11
query5	0.56	0.56	0.57
query6	1.19	0.72	0.73
query7	0.02	0.02	0.01
query8	0.04	0.03	0.03
query9	0.60	0.52	0.51
query10	0.58	0.60	0.57
query11	0.15	0.11	0.10
query12	0.14	0.11	0.11
query13	0.61	0.60	0.60
query14	2.82	2.70	2.72
query15	0.92	0.86	0.85
query16	0.39	0.39	0.38
query17	1.04	1.04	1.03
query18	0.21	0.20	0.19
query19	1.91	1.76	2.03
query20	0.01	0.02	0.01
query21	15.37	0.91	0.54
query22	0.78	1.06	0.59
query23	15.10	1.39	0.59
query24	6.56	1.76	1.58
query25	0.52	0.28	0.10
query26	0.59	0.16	0.14
query27	0.05	0.06	0.05
query28	10.18	0.89	0.43
query29	12.55	3.95	3.30
query30	0.24	0.09	0.08
query31	2.81	0.59	0.38
query32	3.23	0.55	0.47
query33	2.99	3.01	3.01
query34	15.87	5.17	4.51
query35	4.58	4.59	4.56
query36	0.65	0.49	0.49
query37	0.09	0.06	0.07
query38	0.05	0.04	0.03
query39	0.03	0.02	0.03
query40	0.18	0.14	0.14
query41	0.08	0.02	0.02
query42	0.03	0.03	0.02
query43	0.03	0.03	0.03
Total cold run time: 105.71 s
Total hot run time: 31.49 s

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/2.1.x dev/3.0.x p0_w reviewed usercase Important user case type label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants