Skip to content

Conversation

@morrySnow
Copy link
Contributor

What problem does this PR solve?

Related PR: #17393

Problem Summary:

divide const folding for decimalv3 return type is not correct. return scale should be dividend's scale - divider's scale.

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
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?

@morrySnow
Copy link
Contributor Author

run buildall

@morrySnow morrySnow added the usercase Important user case type label label Mar 4, 2025
@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17565	5357	5105	5105
q2	2058	314	169	169
q3	10453	1259	738	738
q4	10209	1020	535	535
q5	7531	2438	2337	2337
q6	189	168	136	136
q7	897	758	627	627
q8	9300	1291	1145	1145
q9	4877	4683	4630	4630
q10	6810	2320	1921	1921
q11	490	285	267	267
q12	350	356	223	223
q13	17773	3732	3109	3109
q14	244	232	215	215
q15	529	468	450	450
q16	620	623	604	604
q17	592	853	366	366
q18	6629	6182	6171	6171
q19	1645	960	557	557
q20	322	327	193	193
q21	2908	2176	1959	1959
q22	379	340	302	302
Total cold run time: 102370 ms
Total hot run time: 31759 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5148	5161	5126	5126
q2	243	330	234	234
q3	2176	2701	2250	2250
q4	1451	1848	1380	1380
q5	4284	4152	4142	4142
q6	217	164	125	125
q7	1856	1825	1699	1699
q8	2616	2659	2606	2606
q9	7184	7150	7254	7150
q10	3029	3220	2789	2789
q11	592	523	482	482
q12	697	803	644	644
q13	3408	3876	3286	3286
q14	302	289	273	273
q15	503	472	455	455
q16	656	671	663	663
q17	1170	1592	1363	1363
q18	7680	7365	7331	7331
q19	797	817	870	817
q20	1968	2019	1891	1891
q21	5452	5048	4715	4715
q22	660	580	548	548
Total cold run time: 52089 ms
Total hot run time: 49969 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 191340 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 48dbe61d9dcb33ae857e7d983e1b683a160867a6, data reload: false

query1	1295	967	965	965
query2	6221	1908	1890	1890
query3	11025	4434	4409	4409
query4	53826	25105	23349	23349
query5	5022	657	489	489
query6	340	213	187	187
query7	4874	519	301	301
query8	321	247	240	240
query9	5445	2644	2655	2644
query10	431	340	288	288
query11	15150	15143	14800	14800
query12	160	106	109	106
query13	1026	525	381	381
query14	11102	7035	7193	7035
query15	207	211	187	187
query16	7151	658	469	469
query17	1073	722	562	562
query18	1572	408	306	306
query19	202	193	173	173
query20	135	150	129	129
query21	209	132	106	106
query22	4404	4574	4356	4356
query23	33875	33442	33208	33208
query24	5708	2429	2467	2429
query25	455	464	404	404
query26	687	276	162	162
query27	1760	509	335	335
query28	2798	2498	2456	2456
query29	585	562	444	444
query30	221	201	163	163
query31	875	878	832	832
query32	81	70	64	64
query33	457	432	331	331
query34	785	870	519	519
query35	833	910	760	760
query36	957	980	900	900
query37	114	97	76	76
query38	4289	4229	4203	4203
query39	1528	1427	1434	1427
query40	209	115	102	102
query41	60	49	49	49
query42	128	112	110	110
query43	526	535	497	497
query44	1362	807	796	796
query45	178	185	169	169
query46	887	1062	653	653
query47	1822	1842	1778	1778
query48	392	426	317	317
query49	700	499	425	425
query50	762	782	449	449
query51	4272	4378	4207	4207
query52	114	108	95	95
query53	240	261	199	199
query54	478	493	418	418
query55	89	85	83	83
query56	275	259	290	259
query57	1170	1167	1103	1103
query58	245	236	247	236
query59	2684	2839	2568	2568
query60	289	281	301	281
query61	119	120	117	117
query62	752	780	690	690
query63	238	199	195	195
query64	1504	1056	671	671
query65	3298	3223	3272	3223
query66	752	407	297	297
query67	16233	15449	15322	15322
query68	5652	889	519	519
query69	525	322	263	263
query70	1213	1109	1103	1103
query71	419	294	260	260
query72	5947	3805	4028	3805
query73	1369	755	360	360
query74	9312	9224	8978	8978
query75	3176	3143	2710	2710
query76	3761	1184	754	754
query77	491	390	285	285
query78	10071	10183	9255	9255
query79	2950	828	605	605
query80	702	510	450	450
query81	514	277	237	237
query82	720	130	102	102
query83	181	174	152	152
query84	288	93	72	72
query85	770	436	312	312
query86	355	312	285	285
query87	4486	4448	4479	4448
query88	3551	2219	2210	2210
query89	418	314	278	278
query90	1645	195	188	188
query91	138	137	108	108
query92	79	64	56	56
query93	2292	1034	585	585
query94	752	421	311	311
query95	342	271	263	263
query96	490	564	271	271
query97	3291	3402	3253	3253
query98	218	204	213	204
query99	1385	1402	1264	1264
Total cold run time: 294480 ms
Total hot run time: 191340 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.08	0.03	0.03
query3	0.24	0.07	0.06
query4	1.62	0.10	0.10
query5	0.55	0.55	0.55
query6	1.18	0.72	0.72
query7	0.03	0.02	0.02
query8	0.04	0.03	0.03
query9	0.59	0.53	0.53
query10	0.57	0.57	0.56
query11	0.16	0.10	0.11
query12	0.15	0.11	0.11
query13	0.61	0.60	0.60
query14	2.80	2.81	2.72
query15	0.90	0.85	0.85
query16	0.38	0.38	0.38
query17	1.02	1.01	1.03
query18	0.21	0.21	0.20
query19	1.94	1.77	1.93
query20	0.01	0.01	0.01
query21	15.38	0.92	0.56
query22	0.75	1.13	0.65
query23	15.00	1.36	0.59
query24	7.29	1.67	0.53
query25	0.51	0.19	0.16
query26	0.58	0.16	0.14
query27	0.05	0.05	0.06
query28	9.32	0.89	0.44
query29	12.53	3.94	3.27
query30	0.25	0.09	0.06
query31	2.81	0.58	0.38
query32	3.24	0.55	0.46
query33	3.10	3.05	3.04
query34	15.75	5.17	4.49
query35	4.56	4.53	4.56
query36	0.66	0.50	0.49
query37	0.09	0.07	0.06
query38	0.05	0.04	0.03
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.02	0.03
query43	0.03	0.03	0.03
Total cold run time: 105.38 s
Total hot run time: 30.53 s

@morrySnow
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17636	5362	5216	5216
q2	2056	312	173	173
q3	10534	1265	810	810
q4	10235	1067	551	551
q5	7647	2419	2375	2375
q6	203	164	130	130
q7	932	760	630	630
q8	9295	1337	1218	1218
q9	5014	4761	4771	4761
q10	6856	2333	1918	1918
q11	488	286	259	259
q12	358	365	235	235
q13	17766	3734	3147	3147
q14	226	229	208	208
q15	522	469	445	445
q16	634	618	595	595
q17	600	900	358	358
q18	6908	6094	6198	6094
q19	1979	973	588	588
q20	327	331	192	192
q21	2739	2479	2047	2047
q22	377	369	313	313
Total cold run time: 103332 ms
Total hot run time: 32263 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5320	5265	5261	5261
q2	248	342	246	246
q3	2141	2707	2264	2264
q4	1551	1904	1426	1426
q5	4274	4157	4208	4157
q6	209	161	126	126
q7	1914	1931	1791	1791
q8	2660	2725	2578	2578
q9	7270	7176	7144	7144
q10	3061	3190	2813	2813
q11	587	521	477	477
q12	703	797	638	638
q13	3416	3917	3320	3320
q14	296	296	271	271
q15	514	471	469	469
q16	642	678	647	647
q17	1185	1631	1371	1371
q18	7640	7336	7429	7336
q19	900	869	970	869
q20	1954	2085	1908	1908
q21	5739	5061	4923	4923
q22	643	589	543	543
Total cold run time: 52867 ms
Total hot run time: 50578 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 190662 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 48dbe61d9dcb33ae857e7d983e1b683a160867a6, data reload: false

query1	1299	932	953	932
query2	6231	1859	1827	1827
query3	11168	4660	4642	4642
query4	25406	23651	22972	22972
query5	4526	677	530	530
query6	306	207	195	195
query7	3986	509	300	300
query8	297	258	239	239
query9	8524	2622	2631	2622
query10	466	324	263	263
query11	15652	15051	14804	14804
query12	167	107	110	107
query13	1577	556	399	399
query14	9796	6424	6966	6424
query15	206	188	206	188
query16	7638	638	483	483
query17	1196	754	610	610
query18	2030	433	325	325
query19	206	218	174	174
query20	127	124	122	122
query21	208	127	109	109
query22	4612	4601	4431	4431
query23	34427	33334	33600	33334
query24	7702	2486	2459	2459
query25	533	469	401	401
query26	1186	281	155	155
query27	2175	508	337	337
query28	4385	2473	2446	2446
query29	650	596	429	429
query30	222	199	160	160
query31	932	886	812	812
query32	70	62	70	62
query33	542	378	314	314
query34	821	933	536	536
query35	811	894	770	770
query36	959	1011	914	914
query37	122	103	78	78
query38	4073	4252	4238	4238
query39	1472	1471	1439	1439
query40	212	122	103	103
query41	53	51	50	50
query42	133	108	103	103
query43	498	519	481	481
query44	1401	818	811	811
query45	184	183	173	173
query46	930	1100	671	671
query47	1814	1839	1761	1761
query48	398	439	307	307
query49	765	540	428	428
query50	760	811	434	434
query51	4299	4335	4318	4318
query52	116	110	94	94
query53	241	278	194	194
query54	493	528	410	410
query55	82	84	79	79
query56	270	281	266	266
query57	1159	1170	1088	1088
query58	249	262	247	247
query59	2679	2793	2667	2667
query60	300	274	271	271
query61	121	117	119	117
query62	815	746	689	689
query63	232	201	212	201
query64	3647	1010	663	663
query65	3348	3263	3216	3216
query66	844	391	303	303
query67	16278	15601	15288	15288
query68	9763	907	505	505
query69	473	292	265	265
query70	1217	1111	1066	1066
query71	491	304	284	284
query72	5093	3616	3845	3616
query73	786	755	359	359
query74	9000	9042	8948	8948
query75	4226	3200	2716	2716
query76	4019	1186	780	780
query77	982	391	276	276
query78	9935	10089	9209	9209
query79	2082	848	600	600
query80	607	532	461	461
query81	484	283	240	240
query82	241	133	98	98
query83	169	174	156	156
query84	282	137	74	74
query85	742	345	304	304
query86	342	310	282	282
query87	4498	4408	4360	4360
query88	2964	2266	2232	2232
query89	423	319	294	294
query90	2118	194	195	194
query91	131	140	108	108
query92	68	59	54	54
query93	1845	1038	580	580
query94	666	413	291	291
query95	356	267	255	255
query96	493	569	276	276
query97	3294	3353	3295	3295
query98	231	217	204	204
query99	1381	1422	1265	1265
Total cold run time: 278429 ms
Total hot run time: 190662 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.07	0.04	0.03
query3	0.25	0.07	0.06
query4	1.61	0.10	0.10
query5	0.55	0.55	0.55
query6	1.20	0.72	0.73
query7	0.02	0.02	0.01
query8	0.05	0.03	0.04
query9	0.57	0.54	0.51
query10	0.58	0.56	0.57
query11	0.15	0.10	0.11
query12	0.15	0.11	0.11
query13	0.63	0.60	0.59
query14	2.78	2.82	2.71
query15	0.92	0.84	0.85
query16	0.38	0.37	0.38
query17	1.01	1.00	1.00
query18	0.20	0.20	0.21
query19	1.89	1.73	1.97
query20	0.01	0.01	0.01
query21	15.35	0.89	0.56
query22	0.76	1.10	0.77
query23	14.90	1.35	0.60
query24	7.40	1.45	1.55
query25	0.53	0.27	0.14
query26	0.50	0.17	0.13
query27	0.06	0.05	0.04
query28	10.40	0.79	0.43
query29	12.60	3.87	3.24
query30	0.24	0.08	0.06
query31	2.81	0.60	0.38
query32	3.23	0.56	0.46
query33	2.93	3.04	3.03
query34	15.67	5.17	4.55
query35	4.55	4.60	4.53
query36	0.64	0.49	0.49
query37	0.09	0.06	0.06
query38	0.05	0.04	0.04
query39	0.02	0.02	0.02
query40	0.17	0.14	0.12
query41	0.07	0.02	0.03
query42	0.04	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 106.11 s
Total hot run time: 31.42 s

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2025

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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2025

PR approved by anyone and no changes requested.

@morrySnow morrySnow merged commit 0264730 into apache:master Mar 5, 2025
29 of 31 checks passed
@morrySnow morrySnow deleted the fix_divide_zero_folding branch March 5, 2025 07:19
github-actions bot pushed a commit that referenced this pull request Mar 5, 2025
…correct (#48641)

### What problem does this PR solve?

Related PR: #17393

Problem Summary:

divide const folding for decimalv3 return type is not correct. return
scale should be dividend's scale - divider's scale.
github-actions bot pushed a commit that referenced this pull request Mar 5, 2025
…correct (#48641)

### What problem does this PR solve?

Related PR: #17393

Problem Summary:

divide const folding for decimalv3 return type is not correct. return
scale should be dividend's scale - divider's scale.
yiguolei pushed a commit that referenced this pull request Mar 5, 2025
…type is not correct #48641 (#48680)

Cherry-picked from #48641

Co-authored-by: morrySnow <zhangwenxin@selectdb.com>
dataroaring pushed a commit that referenced this pull request Mar 10, 2025
…type is not correct #48641 (#48679)

Cherry-picked from #48641

Co-authored-by: morrySnow <zhangwenxin@selectdb.com>
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
…correct (apache#48641)

### What problem does this PR solve?

Related PR: apache#17393

Problem Summary:

divide const folding for decimalv3 return type is not correct. return
scale should be dividend's scale - divider's scale.
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_b reviewed usercase Important user case type label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants