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 overflow of date_add function #35080

Merged
merged 2 commits into from
May 21, 2024

Conversation

zclllyybb
Copy link
Contributor

Proposed changes

Issue Number: close #xxx

before:

select date_add("1900-01-01 12:00:00.123456", interval 10000000000 month);
------
r838-09-01 12:00:00.123456

now:

ERROR 1105 (HY000): errCode = 2, detailMessage = (xxx)[E-218][E-218] Operation months_add 133705200962757184 1410065408 out of range

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@zclllyybb
Copy link
Contributor Author

run buildall

Copy link
Contributor

@github-actions github-actions bot left a 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

be/src/vec/runtime/vdatetime_value.h Show resolved Hide resolved
@zclllyybb
Copy link
Contributor Author

run buildall

1 similar comment
@zclllyybb
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.69% (9013/25251)
Line Coverage: 27.35% (74540/272584)
Region Coverage: 26.59% (38540/144942)
Branch Coverage: 23.42% (19663/83954)
Coverage Report: http://coverage.selectdb-in.cc/coverage/42ebd558f4aa63534078bbc5588930160af2e09c_42ebd558f4aa63534078bbc5588930160af2e09c/report/index.html

@zclllyybb
Copy link
Contributor Author

run buildall

HappenLee
HappenLee previously approved these changes May 21, 2024
Copy link
Contributor

@HappenLee HappenLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

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

@github-actions github-actions bot added approved Indicates a PR has been approved by one committer. reviewed labels May 21, 2024
Copy link
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.69% (9013/25251)
Line Coverage: 27.35% (74544/272601)
Region Coverage: 26.59% (38541/144955)
Branch Coverage: 23.42% (19664/83964)
Coverage Report: http://coverage.selectdb-in.cc/coverage/6b4bbf3985cb929159c92f8c2cc3a260ca135790_6b4bbf3985cb929159c92f8c2cc3a260ca135790/report/index.html

zhangstar333
zhangstar333 previously approved these changes May 21, 2024
@zclllyybb
Copy link
Contributor Author

run buildall

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label May 21, 2024
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label May 21, 2024
Copy link
Contributor

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

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17884	4582	4439	4439
q2	2649	205	198	198
q3	11689	1199	1247	1199
q4	10728	908	783	783
q5	7502	2751	2697	2697
q6	220	130	135	130
q7	1062	606	571	571
q8	9230	2146	2094	2094
q9	8807	6606	6552	6552
q10	8857	3772	3681	3681
q11	463	239	242	239
q12	425	225	215	215
q13	17772	2964	2953	2953
q14	274	210	225	210
q15	509	464	470	464
q16	531	389	404	389
q17	980	786	779	779
q18	8114	7440	7594	7440
q19	3784	1562	1550	1550
q20	643	296	296	296
q21	5156	4007	4010	4007
q22	343	276	277	276
Total cold run time: 117622 ms
Total hot run time: 41162 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4334	4225	4212	4212
q2	381	274	264	264
q3	3025	2708	2767	2708
q4	1885	1585	1640	1585
q5	5286	5303	5310	5303
q6	213	123	127	123
q7	2217	1929	1865	1865
q8	3216	3374	3365	3365
q9	8397	8366	8313	8313
q10	3874	3714	3702	3702
q11	589	486	488	486
q12	755	583	618	583
q13	17362	2972	2992	2972
q14	293	285	283	283
q15	522	487	476	476
q16	474	415	409	409
q17	1794	1507	1464	1464
q18	7698	7517	7324	7324
q19	1678	1587	1547	1547
q20	1994	1817	1775	1775
q21	5007	4938	5018	4938
q22	543	501	497	497
Total cold run time: 71537 ms
Total hot run time: 54194 ms

@doris-robot
Copy link

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

query1	912	394	394	394
query2	6472	2421	2431	2421
query3	6654	215	213	213
query4	24428	21180	21352	21180
query5	4184	421	422	421
query6	261	170	171	170
query7	4585	287	288	287
query8	247	199	202	199
query9	8469	2397	2387	2387
query10	445	252	245	245
query11	14836	14208	14229	14208
query12	137	92	89	89
query13	1645	372	374	372
query14	11058	8485	8336	8336
query15	286	169	170	169
query16	8139	255	259	255
query17	1885	563	548	548
query18	2061	272	263	263
query19	304	153	151	151
query20	89	87	84	84
query21	197	124	124	124
query22	5091	4849	4819	4819
query23	34472	33322	33634	33322
query24	11591	2815	2872	2815
query25	651	388	365	365
query26	1741	158	149	149
query27	2858	316	330	316
query28	7390	2026	2018	2018
query29	1003	622	594	594
query30	327	171	178	171
query31	1011	747	743	743
query32	84	53	54	53
query33	743	243	240	240
query34	1092	468	469	468
query35	812	699	659	659
query36	1107	866	926	866
query37	277	69	70	69
query38	2899	2754	2771	2754
query39	1637	1561	1556	1556
query40	269	126	123	123
query41	46	44	43	43
query42	105	95	95	95
query43	573	533	525	525
query44	1189	719	739	719
query45	274	255	260	255
query46	1083	718	707	707
query47	1965	1875	1873	1873
query48	360	309	297	297
query49	1216	388	392	388
query50	767	380	383	380
query51	6952	6791	6834	6791
query52	107	87	89	87
query53	356	283	275	275
query54	937	415	418	415
query55	74	74	72	72
query56	237	216	221	216
query57	1277	1157	1153	1153
query58	220	203	204	203
query59	3577	3231	3383	3231
query60	275	238	237	237
query61	88	104	88	88
query62	664	467	466	466
query63	310	283	277	277
query64	9855	2215	1732	1732
query65	3182	3146	3128	3128
query66	1366	342	344	342
query67	15267	14895	15022	14895
query68	5729	526	525	525
query69	530	304	295	295
query70	1209	1125	1145	1125
query71	473	266	262	262
query72	7686	2745	2388	2388
query73	757	325	336	325
query74	6657	6195	6312	6195
query75	3952	2654	2629	2629
query76	3667	1014	951	951
query77	614	268	262	262
query78	10687	10214	9984	9984
query79	2393	509	520	509
query80	1242	421	424	421
query81	499	242	246	242
query82	721	97	99	97
query83	190	165	164	164
query84	262	84	91	84
query85	1391	271	260	260
query86	412	287	325	287
query87	3321	3136	3123	3123
query88	4293	2325	2337	2325
query89	463	377	379	377
query90	2018	181	186	181
query91	122	101	96	96
query92	55	48	48	48
query93	3504	499	487	487
query94	1163	176	176	176
query95	394	336	300	300
query96	602	267	265	265
query97	3223	3018	3017	3017
query98	233	218	224	218
query99	1288	899	907	899
Total cold run time: 294421 ms
Total hot run time: 182023 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.09	0.03	0.04
query3	0.23	0.05	0.05
query4	1.69	0.07	0.06
query5	0.50	0.50	0.50
query6	1.12	0.72	0.73
query7	0.02	0.02	0.01
query8	0.05	0.04	0.04
query9	0.55	0.50	0.50
query10	0.54	0.54	0.54
query11	0.16	0.12	0.11
query12	0.15	0.12	0.12
query13	0.60	0.59	0.60
query14	0.78	0.77	0.78
query15	0.83	0.81	0.79
query16	0.37	0.36	0.37
query17	1.01	0.96	1.01
query18	0.24	0.25	0.23
query19	1.80	1.76	1.81
query20	0.02	0.01	0.01
query21	15.71	0.67	0.65
query22	4.99	6.95	1.75
query23	18.28	1.43	1.28
query24	1.80	0.28	0.21
query25	0.14	0.08	0.08
query26	0.26	0.17	0.17
query27	0.08	0.08	0.08
query28	13.29	1.00	0.99
query29	13.21	3.27	3.28
query30	0.25	0.05	0.05
query31	2.88	0.39	0.38
query32	3.28	0.49	0.47
query33	2.90	2.89	2.94
query34	17.17	4.40	4.40
query35	4.53	4.50	4.52
query36	0.66	0.45	0.45
query37	0.17	0.15	0.16
query38	0.15	0.14	0.15
query39	0.05	0.04	0.04
query40	0.17	0.15	0.14
query41	0.09	0.04	0.04
query42	0.06	0.05	0.05
query43	0.04	0.04	0.04
Total cold run time: 110.95 s
Total hot run time: 30.4 s

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 35.70% (9018/25263)
Line Coverage: 27.35% (74570/272695)
Region Coverage: 26.55% (38539/145134)
Branch Coverage: 23.40% (19660/84018)
Coverage Report: http://coverage.selectdb-in.cc/coverage/fdf048c5300b2a556587a7290e0742ce10675adb_fdf048c5300b2a556587a7290e0742ce10675adb/report/index.html

Copy link
Contributor

@HappenLee HappenLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BiteTheDDDDt BiteTheDDDDt merged commit fedeab0 into apache:master May 21, 2024
26 of 30 checks passed
zclllyybb added a commit to zclllyybb/doris that referenced this pull request May 22, 2024
zclllyybb added a commit to zclllyybb/doris that referenced this pull request May 22, 2024
yiguolei pushed a commit that referenced this pull request May 22, 2024
zclllyybb added a commit to zclllyybb/doris that referenced this pull request May 22, 2024
xiaokang pushed a commit that referenced this pull request May 23, 2024
…35169)

Co-authored-by: zhiqiang <seuhezhiqiang@163.com>
M1saka2003 pushed a commit to M1saka2003/doris that referenced this pull request May 24, 2024
dataroaring pushed a commit that referenced this pull request May 26, 2024
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.0.11-merged dev/2.1.x reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants