doris icon indicating copy to clipboard operation
doris copied to clipboard

[fix](function) fix nereids fold constant wrong result of abs

Open zclllyybb opened this issue 1 year ago • 10 comments

Proposed changes

Issue Number: close #xxx

before:

mysql [optest]>select abs(cast(-9223372036854775808  as BIGINT));
+-------------------------------------------+
| abs(cast(-9223372036854775808 as BIGINT)) |
+-------------------------------------------+
| -9223372036854775808                      |
+-------------------------------------------+
1 row in set (0.00 sec)

now:

mysql [optest]>select abs(cast(-9223372036854775808  as BIGINT));
+-------------------------------------------+
| abs(cast(-9223372036854775808 as BIGINT)) |
+-------------------------------------------+
| 9223372036854775808                       |
+-------------------------------------------+
1 row in set (0.01 sec)

zclllyybb avatar Jul 01 '24 06:07 zclllyybb

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.

doris-robot avatar Jul 01 '24 06:07 doris-robot

run buildall

zclllyybb avatar Jul 01 '24 06:07 zclllyybb

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

github-actions[bot] avatar Jul 01 '24 06:07 github-actions[bot]

PR approved by anyone and no changes requested.

github-actions[bot] avatar Jul 01 '24 06:07 github-actions[bot]

run buildall

zclllyybb avatar Jul 01 '24 06:07 zclllyybb

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

------ Round 1 ----------------------------------
q1	17599	5069	4296	4296
q2	2015	190	191	190
q3	10456	1251	1093	1093
q4	10187	786	809	786
q5	7536	2690	2554	2554
q6	219	135	137	135
q7	960	603	605	603
q8	9223	2086	2071	2071
q9	9058	6505	6459	6459
q10	8889	3744	3696	3696
q11	462	232	239	232
q12	406	227	229	227
q13	17779	2938	2944	2938
q14	269	225	213	213
q15	533	477	475	475
q16	518	372	378	372
q17	969	609	729	609
q18	8034	7555	7378	7378
q19	6963	1527	1392	1392
q20	662	327	339	327
q21	4907	3143	3260	3143
q22	379	336	334	334
Total cold run time: 118023 ms
Total hot run time: 39523 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4393	4173	4212	4173
q2	376	264	258	258
q3	2980	2956	2875	2875
q4	2019	1687	1732	1687
q5	5622	5541	5437	5437
q6	225	128	129	128
q7	2181	1894	1843	1843
q8	3248	3387	3398	3387
q9	8755	8623	8918	8623
q10	4106	3863	3734	3734
q11	597	526	482	482
q12	817	642	659	642
q13	17024	3184	3184	3184
q14	302	289	281	281
q15	539	492	470	470
q16	491	424	426	424
q17	1849	1518	1480	1480
q18	8181	8001	7751	7751
q19	1814	1706	1616	1616
q20	2165	1888	1861	1861
q21	5219	4945	4789	4789
q22	666	555	573	555
Total cold run time: 73569 ms
Total hot run time: 55680 ms

doris-robot avatar Jul 01 '24 08:07 doris-robot

run buildall

zclllyybb avatar Jul 01 '24 08:07 zclllyybb

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

------ Round 1 ----------------------------------
q1	17634	4366	4848	4366
q2	2007	188	189	188
q3	10498	1213	1146	1146
q4	10197	811	795	795
q5	7491	2661	2653	2653
q6	219	135	135	135
q7	937	600	597	597
q8	9222	2051	2034	2034
q9	8753	6487	6456	6456
q10	8793	3673	3758	3673
q11	434	236	238	236
q12	478	234	226	226
q13	17757	2986	3020	2986
q14	263	229	231	229
q15	521	483	474	474
q16	487	367	372	367
q17	959	711	661	661
q18	8057	7503	7392	7392
q19	6283	1436	1510	1436
q20	649	319	329	319
q21	4909	3190	3971	3190
q22	394	342	341	341
Total cold run time: 116942 ms
Total hot run time: 39900 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4411	4198	4236	4198
q2	361	265	261	261
q3	2976	2874	2859	2859
q4	2027	1696	1763	1696
q5	5554	5468	5473	5468
q6	225	131	128	128
q7	2188	1898	1849	1849
q8	3280	3380	3408	3380
q9	8670	8642	8784	8642
q10	4069	3928	3791	3791
q11	595	482	505	482
q12	807	663	633	633
q13	17190	3146	3136	3136
q14	303	263	280	263
q15	538	480	553	480
q16	498	435	436	435
q17	1801	1561	1487	1487
q18	8021	7985	7814	7814
q19	1794	1670	1689	1670
q20	2145	1889	1838	1838
q21	5046	5045	4864	4864
q22	616	569	560	560
Total cold run time: 73115 ms
Total hot run time: 55934 ms

doris-robot avatar Jul 01 '24 09:07 doris-robot

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

query1	907	384	372	372
query2	6452	2541	2373	2373
query3	6650	208	212	208
query4	18810	17564	17329	17329
query5	3669	472	472	472
query6	272	166	170	166
query7	4597	294	294	294
query8	324	302	302	302
query9	8656	2388	2381	2381
query10	556	293	270	270
query11	10657	10068	10189	10068
query12	116	88	82	82
query13	1642	362	358	358
query14	9598	7757	6879	6879
query15	223	186	184	184
query16	7668	267	259	259
query17	1916	535	540	535
query18	1900	268	267	267
query19	195	148	152	148
query20	92	82	84	82
query21	206	135	127	127
query22	4468	4295	4173	4173
query23	34029	33892	33620	33620
query24	9699	2895	2877	2877
query25	606	378	377	377
query26	718	154	148	148
query27	2258	318	319	318
query28	6100	2129	2134	2129
query29	884	635	644	635
query30	234	160	160	160
query31	966	746	749	746
query32	99	55	54	54
query33	648	340	285	285
query34	857	473	488	473
query35	723	632	617	617
query36	1125	987	984	984
query37	138	78	81	78
query38	2992	2968	2833	2833
query39	905	853	825	825
query40	211	136	129	129
query41	54	50	52	50
query42	115	108	100	100
query43	586	552	538	538
query44	1054	735	723	723
query45	190	165	171	165
query46	1064	723	694	694
query47	1871	1796	1811	1796
query48	363	302	290	290
query49	848	425	429	425
query50	772	391	379	379
query51	6766	6789	6649	6649
query52	110	90	93	90
query53	359	304	282	282
query54	815	447	456	447
query55	77	77	76	76
query56	296	282	285	282
query57	1185	1079	1055	1055
query58	256	242	238	238
query59	3432	3221	3080	3080
query60	308	283	269	269
query61	99	94	100	94
query62	585	465	438	438
query63	316	298	287	287
query64	8497	2263	1823	1823
query65	3145	3098	3108	3098
query66	746	327	333	327
query67	15366	14916	14971	14916
query68	4579	530	541	530
query69	545	392	329	329
query70	1114	1060	1143	1060
query71	357	274	276	274
query72	6919	5251	5593	5251
query73	731	324	323	323
query74	5866	5542	5484	5484
query75	3364	2693	2742	2693
query76	2172	946	958	946
query77	451	294	306	294
query78	10235	9900	9633	9633
query79	2298	512	519	512
query80	1012	465	474	465
query81	550	217	213	213
query82	1390	103	109	103
query83	274	171	169	169
query84	229	86	82	82
query85	1306	294	280	280
query86	467	304	305	304
query87	3337	3127	3120	3120
query88	3915	2347	2344	2344
query89	474	380	397	380
query90	1765	253	183	183
query91	124	99	102	99
query92	58	46	47	46
query93	2341	497	493	493
query94	1117	183	184	183
query95	395	320	318	318
query96	583	264	262	262
query97	3189	3042	2979	2979
query98	229	201	199	199
query99	1119	848	888	848
Total cold run time: 264546 ms
Total hot run time: 173627 ms

doris-robot avatar Jul 01 '24 09:07 doris-robot

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

query1	0.04	0.03	0.03
query2	0.09	0.04	0.04
query3	0.22	0.05	0.06
query4	1.67	0.07	0.08
query5	0.49	0.48	0.49
query6	1.13	0.74	0.73
query7	0.02	0.01	0.02
query8	0.05	0.06	0.05
query9	0.54	0.50	0.50
query10	0.56	0.54	0.56
query11	0.16	0.12	0.11
query12	0.15	0.12	0.12
query13	0.60	0.59	0.59
query14	0.76	0.79	0.78
query15	0.86	0.82	0.80
query16	0.38	0.37	0.35
query17	1.05	1.02	0.96
query18	0.23	0.25	0.24
query19	1.87	1.77	1.67
query20	0.02	0.01	0.01
query21	15.43	0.73	0.66
query22	3.72	7.45	1.95
query23	18.27	1.43	1.29
query24	2.17	0.24	0.22
query25	0.17	0.09	0.09
query26	0.25	0.17	0.18
query27	0.08	0.08	0.08
query28	13.16	1.02	0.99
query29	12.62	3.29	3.25
query30	0.25	0.06	0.06
query31	2.88	0.39	0.39
query32	3.28	0.47	0.47
query33	2.87	2.87	2.86
query34	17.22	4.45	4.43
query35	4.51	4.53	4.56
query36	0.64	0.48	0.46
query37	0.19	0.16	0.15
query38	0.16	0.15	0.15
query39	0.05	0.03	0.04
query40	0.18	0.14	0.14
query41	0.09	0.05	0.05
query42	0.06	0.05	0.05
query43	0.04	0.03	0.04
Total cold run time: 109.18 s
Total hot run time: 30.63 s

doris-robot avatar Jul 01 '24 09:07 doris-robot

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

github-actions[bot] avatar Jul 01 '24 12:07 github-actions[bot]