Skip to content

Conversation

@yujun777
Copy link
Contributor

@yujun777 yujun777 commented Mar 17, 2025

What problem does this PR solve?

As doc to-monday said, for date between 1970-01-01 and 1970-01-04, to_monday(date) = '1970-01-01', this PR fix this.

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

@Thearas
Copy link
Contributor

Thearas commented Mar 17, 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?

@yujun777
Copy link
Contributor Author

run buildall

@yujun777 yujun777 marked this pull request as draft March 17, 2025 09:19
@yujun777 yujun777 marked this pull request as ready for review March 17, 2025 09:19
@yujun777 yujun777 marked this pull request as draft March 17, 2025 09:20
@yujun777 yujun777 marked this pull request as ready for review March 17, 2025 09:20
@yujun777 yujun777 closed this Mar 17, 2025
@yujun777 yujun777 reopened this Mar 17, 2025
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 17, 2025
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@yujun777 yujun777 changed the title [fix](nereids) fix to_monday('1970-01-04') [fix](nereids) fix to_monday('1970-01-04 23:59:59') Mar 17, 2025
@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	24235	5121	5020	5020
q2	2041	306	180	180
q3	10532	1263	687	687
q4	10259	997	537	537
q5	8571	2421	2363	2363
q6	187	164	133	133
q7	955	761	620	620
q8	9307	1280	1077	1077
q9	5099	4653	4865	4653
q10	6807	2297	1887	1887
q11	493	281	270	270
q12	362	356	228	228
q13	17785	3734	3125	3125
q14	239	243	221	221
q15	524	491	471	471
q16	627	598	586	586
q17	577	827	393	393
q18	7178	6439	6389	6389
q19	1225	978	562	562
q20	323	356	220	220
q21	2890	2189	1970	1970
q22	984	1022	984	984
Total cold run time: 111200 ms
Total hot run time: 32576 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5194	5146	5127	5127
q2	237	336	228	228
q3	2146	2708	2301	2301
q4	1474	1874	1478	1478
q5	4237	4226	4511	4226
q6	225	177	131	131
q7	2071	1935	1783	1783
q8	2581	2642	2557	2557
q9	7095	7135	7126	7126
q10	3034	3166	2822	2822
q11	572	500	490	490
q12	689	750	583	583
q13	3602	3871	3318	3318
q14	281	301	274	274
q15	535	478	481	478
q16	650	695	646	646
q17	1143	1563	1358	1358
q18	7646	7505	7362	7362
q19	818	838	943	838
q20	1959	1997	1947	1947
q21	5526	4875	4754	4754
q22	1066	1003	991	991
Total cold run time: 52781 ms
Total hot run time: 50818 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 185314 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 c41acd05137a8a141526f4ee84be7ef63837f7ad, data reload: false

query1	996	464	464	464
query2	6541	1920	1846	1846
query3	6816	224	225	224
query4	26175	23627	23458	23458
query5	4374	650	478	478
query6	278	185	178	178
query7	4594	484	292	292
query8	296	232	223	223
query9	8612	2529	2507	2507
query10	487	312	258	258
query11	15494	15164	15138	15138
query12	155	116	101	101
query13	1657	536	441	441
query14	9340	6581	6724	6581
query15	200	185	160	160
query16	7712	622	464	464
query17	1187	684	573	573
query18	1983	387	300	300
query19	180	180	148	148
query20	117	112	108	108
query21	210	121	102	102
query22	4262	4097	4035	4035
query23	33883	33048	32981	32981
query24	7712	2374	2382	2374
query25	501	440	374	374
query26	1214	267	154	154
query27	2277	475	323	323
query28	4060	2385	2385	2385
query29	682	577	409	409
query30	280	219	185	185
query31	967	857	765	765
query32	74	64	64	64
query33	575	364	314	314
query34	785	835	499	499
query35	806	858	741	741
query36	960	992	877	877
query37	126	95	75	75
query38	4073	4066	4146	4066
query39	1460	1406	1367	1367
query40	213	117	110	110
query41	56	53	50	50
query42	116	105	103	103
query43	471	510	470	470
query44	1292	774	774	774
query45	172	169	161	161
query46	819	1018	615	615
query47	1738	1784	1685	1685
query48	372	406	298	298
query49	790	508	439	439
query50	687	723	396	396
query51	4154	4133	4159	4133
query52	102	100	93	93
query53	227	275	191	191
query54	487	480	427	427
query55	84	85	85	85
query56	266	256	244	244
query57	1084	1125	1065	1065
query58	247	234	239	234
query59	2470	2617	2475	2475
query60	280	274	253	253
query61	120	118	119	118
query62	791	751	667	667
query63	240	183	182	182
query64	4265	1005	671	671
query65	4441	4401	4297	4297
query66	1089	421	317	317
query67	15686	15415	15168	15168
query68	8044	874	503	503
query69	487	313	275	275
query70	1193	1171	1114	1114
query71	447	318	261	261
query72	5492	3547	3723	3547
query73	726	729	350	350
query74	8895	9131	8959	8959
query75	3192	3147	2683	2683
query76	3220	1253	736	736
query77	540	371	286	286
query78	9920	10169	9258	9258
query79	2640	816	573	573
query80	667	530	450	450
query81	492	254	223	223
query82	233	125	99	99
query83	190	169	163	163
query84	250	89	72	72
query85	880	369	309	309
query86	374	307	290	290
query87	4663	4586	4356	4356
query88	3955	2236	2203	2203
query89	397	324	281	281
query90	1889	217	212	212
query91	139	142	108	108
query92	79	65	54	54
query93	2391	1041	580	580
query94	687	406	305	305
query95	359	273	266	266
query96	479	577	279	279
query97	3259	3454	3294	3294
query98	236	205	217	205
query99	1362	1429	1267	1267
Total cold run time: 272637 ms
Total hot run time: 185314 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.04
query2	0.13	0.10	0.11
query3	0.25	0.19	0.19
query4	1.59	0.20	0.20
query5	0.59	0.58	0.59
query6	1.21	0.72	0.71
query7	0.02	0.02	0.01
query8	0.04	0.03	0.03
query9	0.59	0.53	0.51
query10	0.58	0.59	0.58
query11	0.15	0.11	0.11
query12	0.15	0.11	0.11
query13	0.61	0.60	0.60
query14	2.80	2.81	2.84
query15	0.92	0.83	0.85
query16	0.39	0.38	0.37
query17	1.04	1.03	1.00
query18	0.22	0.20	0.20
query19	1.90	2.00	1.88
query20	0.02	0.02	0.01
query21	15.37	0.89	0.55
query22	0.77	1.21	0.63
query23	14.93	1.41	0.63
query24	6.75	1.77	0.72
query25	0.46	0.22	0.12
query26	0.64	0.16	0.13
query27	0.06	0.05	0.05
query28	9.20	0.86	0.44
query29	12.58	4.02	3.31
query30	0.25	0.10	0.06
query31	2.82	0.60	0.38
query32	3.22	0.54	0.46
query33	3.06	3.01	3.04
query34	15.79	5.11	4.47
query35	4.52	4.54	4.56
query36	0.66	0.49	0.48
query37	0.09	0.06	0.06
query38	0.05	0.04	0.04
query39	0.03	0.03	0.03
query40	0.17	0.14	0.13
query41	0.09	0.03	0.03
query42	0.04	0.03	0.02
query43	0.03	0.03	0.03
Total cold run time: 104.82 s
Total hot run time: 31.19 s

@yujun777
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	24191	5089	5218	5089
q2	2050	300	173	173
q3	10428	1281	690	690
q4	10263	1028	538	538
q5	8207	2465	2361	2361
q6	193	163	134	134
q7	926	734	604	604
q8	9302	1337	1142	1142
q9	4980	4740	4930	4740
q10	6809	2333	1882	1882
q11	484	277	262	262
q12	346	349	225	225
q13	17781	3677	3048	3048
q14	241	232	223	223
q15	562	504	497	497
q16	636	624	597	597
q17	601	862	350	350
q18	6899	6550	6348	6348
q19	1342	957	566	566
q20	325	347	201	201
q21	2921	2196	2001	2001
q22	1067	1038	987	987
Total cold run time: 110554 ms
Total hot run time: 32658 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5388	5673	5107	5107
q2	247	326	231	231
q3	2133	2670	2288	2288
q4	1431	1820	1376	1376
q5	4239	4279	4475	4279
q6	217	167	129	129
q7	2065	1900	1772	1772
q8	2688	2715	2547	2547
q9	7396	7260	7246	7246
q10	3053	3276	2792	2792
q11	576	520	482	482
q12	733	772	611	611
q13	3373	3862	3273	3273
q14	282	288	263	263
q15	546	500	495	495
q16	649	682	657	657
q17	1183	1556	1349	1349
q18	7796	7651	7454	7454
q19	858	862	913	862
q20	1951	2028	1859	1859
q21	5393	4765	4592	4592
q22	1109	1057	1003	1003
Total cold run time: 53306 ms
Total hot run time: 50667 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 184995 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 c41acd05137a8a141526f4ee84be7ef63837f7ad, data reload: false

query1	1024	502	460	460
query2	6542	1914	1888	1888
query3	6811	221	215	215
query4	26942	23308	22906	22906
query5	4338	670	507	507
query6	308	202	183	183
query7	4608	495	293	293
query8	305	241	253	241
query9	8616	2512	2516	2512
query10	468	309	258	258
query11	15989	15052	14893	14893
query12	164	117	105	105
query13	1656	538	395	395
query14	10092	6300	6408	6300
query15	210	194	174	174
query16	7210	651	485	485
query17	1200	734	575	575
query18	1955	398	307	307
query19	195	190	161	161
query20	121	118	119	118
query21	213	119	107	107
query22	4290	4174	3976	3976
query23	33860	32998	33184	32998
query24	7772	2415	2403	2403
query25	535	450	391	391
query26	1244	271	152	152
query27	2272	478	334	334
query28	4035	2408	2360	2360
query29	738	572	443	443
query30	281	217	187	187
query31	952	835	776	776
query32	75	67	64	64
query33	560	383	316	316
query34	805	846	495	495
query35	781	844	741	741
query36	957	982	876	876
query37	123	99	77	77
query38	4401	4166	4043	4043
query39	1455	1402	1399	1399
query40	214	117	108	108
query41	55	51	50	50
query42	125	105	124	105
query43	498	515	466	466
query44	1337	776	779	776
query45	172	170	168	168
query46	890	1036	628	628
query47	1737	1777	1696	1696
query48	370	405	298	298
query49	796	529	427	427
query50	726	730	409	409
query51	4177	4186	4157	4157
query52	110	103	101	101
query53	237	263	198	198
query54	497	496	419	419
query55	84	86	81	81
query56	292	264	256	256
query57	1153	1130	1060	1060
query58	243	235	230	230
query59	2668	2547	2522	2522
query60	286	297	253	253
query61	125	119	119	119
query62	781	758	657	657
query63	229	188	190	188
query64	4367	1011	726	726
query65	4408	4352	4356	4352
query66	1139	405	305	305
query67	15734	15455	15440	15440
query68	8596	883	514	514
query69	461	317	259	259
query70	1219	1159	1013	1013
query71	478	304	277	277
query72	5731	3571	3710	3571
query73	783	721	341	341
query74	8969	9270	9005	9005
query75	3879	3162	2714	2714
query76	3719	1170	744	744
query77	791	448	285	285
query78	10298	10019	9267	9267
query79	2569	822	582	582
query80	678	533	459	459
query81	480	261	221	221
query82	702	126	100	100
query83	177	164	151	151
query84	243	89	83	83
query85	806	352	301	301
query86	390	292	295	292
query87	4515	4553	4408	4408
query88	3659	2205	2227	2205
query89	401	312	291	291
query90	1899	209	217	209
query91	147	138	111	111
query92	76	62	57	57
query93	1714	1072	579	579
query94	659	403	323	323
query95	357	271	264	264
query96	492	548	281	281
query97	3340	3357	3317	3317
query98	219	200	202	200
query99	1454	1379	1262	1262
Total cold run time: 277454 ms
Total hot run time: 184995 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.12	0.10	0.11
query3	0.25	0.19	0.20
query4	1.60	0.20	0.19
query5	0.58	0.58	0.59
query6	1.18	0.72	0.71
query7	0.03	0.02	0.02
query8	0.04	0.03	0.04
query9	0.59	0.54	0.53
query10	0.58	0.59	0.57
query11	0.16	0.11	0.11
query12	0.14	0.11	0.11
query13	0.62	0.60	0.59
query14	2.71	2.69	2.69
query15	0.92	0.84	0.86
query16	0.40	0.38	0.37
query17	1.04	1.01	1.05
query18	0.21	0.20	0.20
query19	1.92	1.93	1.83
query20	0.02	0.02	0.01
query21	15.38	0.91	0.55
query22	0.78	1.43	1.02
query23	14.70	1.39	0.63
query24	7.33	1.08	1.06
query25	0.52	0.20	0.22
query26	0.62	0.17	0.13
query27	0.04	0.05	0.05
query28	9.11	0.82	0.41
query29	12.54	3.94	3.27
query30	0.25	0.10	0.07
query31	2.81	0.60	0.39
query32	3.22	0.56	0.47
query33	3.00	3.11	3.01
query34	15.82	5.21	4.54
query35	4.53	4.62	4.58
query36	0.66	0.50	0.48
query37	0.08	0.06	0.06
query38	0.06	0.04	0.04
query39	0.03	0.03	0.02
query40	0.17	0.13	0.13
query41	0.08	0.03	0.02
query42	0.04	0.03	0.02
query43	0.03	0.03	0.02
Total cold run time: 104.95 s
Total hot run time: 31.88 s

@starocean999 starocean999 merged commit 8d6d952 into apache:master Mar 18, 2025
45 of 46 checks passed
github-actions bot pushed a commit that referenced this pull request Mar 18, 2025
As doc
[to-monday](https://doris.apache.org/docs/2.0/sql-manual/sql-functions/date-time-functions/to-monday)
said, for date between 1970-01-01 and 1970-01-04, to_monday(date) =
'1970-01-01', this PR fix this.
github-actions bot pushed a commit that referenced this pull request Mar 18, 2025
As doc
[to-monday](https://doris.apache.org/docs/2.0/sql-manual/sql-functions/date-time-functions/to-monday)
said, for date between 1970-01-01 and 1970-01-04, to_monday(date) =
'1970-01-01', this PR fix this.
yiguolei pushed a commit that referenced this pull request Mar 18, 2025
#49176)

Cherry-picked from #49153

Co-authored-by: yujun <yujun@selectdb.com>
dataroaring pushed a commit that referenced this pull request Mar 20, 2025
#49175)

Cherry-picked from #49153

Co-authored-by: yujun <yujun@selectdb.com>
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
As doc
[to-monday](https://doris.apache.org/docs/2.0/sql-manual/sql-functions/date-time-functions/to-monday)
said, for date between 1970-01-01 and 1970-01-04, to_monday(date) =
'1970-01-01', this PR fix this.
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.9-merged dev/3.0.5-merged p0_w reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants