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](Nereids) change numeric arithmatic function boundary behavior to match with be execution behavior #47966

Merged
merged 3 commits into from
Feb 19, 2025

Conversation

LiBinfeng-01
Copy link
Collaborator

@LiBinfeng-01 LiBinfeng-01 commented Feb 17, 2025

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #40744#47228

Problem Summary:
When numeric function input or output out of boundary when fe folding constant, it would throw an exception before. Now
we change it to match with be execution result, which is NullLiteral

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?

Comment on lines +199 to +200
// testFoldConst("SELECT COSH(1E308)")
// testFoldConst("SELECT COSH(-1E308)")
Copy link
Contributor

Choose a reason for hiding this comment

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

why comments?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

COSH/POWER/DEGREES functions would meet inf problem when input is to large, be execute need to fix it

@LiBinfeng-01
Copy link
Collaborator Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17603	5203	5056	5056
q2	2034	307	167	167
q3	10411	1371	709	709
q4	10213	1013	536	536
q5	7535	2345	2346	2345
q6	192	165	133	133
q7	902	747	599	599
q8	9313	1300	1071	1071
q9	4891	4747	4649	4649
q10	6802	2300	1896	1896
q11	473	269	264	264
q12	342	347	212	212
q13	17767	3661	3063	3063
q14	228	230	200	200
q15	513	469	463	463
q16	625	624	585	585
q17	574	861	344	344
q18	6871	6169	6152	6152
q19	1076	963	540	540
q20	320	323	198	198
q21	2732	2129	1929	1929
q22	369	321	313	313
Total cold run time: 101786 ms
Total hot run time: 31424 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5069	5125	5128	5125
q2	233	342	238	238
q3	2121	2682	2280	2280
q4	1459	1854	1381	1381
q5	4238	4108	4126	4108
q6	206	159	126	126
q7	1890	1787	1661	1661
q8	2582	2576	2514	2514
q9	7264	7101	7147	7101
q10	2989	3142	2806	2806
q11	574	495	487	487
q12	688	763	604	604
q13	3541	3829	3218	3218
q14	276	280	271	271
q15	530	477	457	457
q16	626	670	624	624
q17	1111	1545	1348	1348
q18	7608	7318	7300	7300
q19	803	833	930	833
q20	1954	2012	1849	1849
q21	5323	4939	4851	4851
q22	636	594	540	540
Total cold run time: 51721 ms
Total hot run time: 49722 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 183004 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 5040d4877e3bf4220bc12204b2189bb25448e40f, data reload: false

query1	994	365	392	365
query2	6516	1809	1811	1809
query3	6803	212	213	212
query4	26949	23269	23401	23269
query5	4313	646	463	463
query6	304	198	188	188
query7	4597	501	299	299
query8	296	239	240	239
query9	8636	2490	2476	2476
query10	466	330	257	257
query11	15465	15227	14954	14954
query12	155	107	103	103
query13	1660	526	382	382
query14	9589	6345	6946	6345
query15	219	200	182	182
query16	7714	643	477	477
query17	1560	725	560	560
query18	1988	410	313	313
query19	200	196	164	164
query20	123	113	121	113
query21	206	124	106	106
query22	4250	4434	4545	4434
query23	34433	33334	32987	32987
query24	7699	2360	2370	2360
query25	490	481	380	380
query26	1219	273	145	145
query27	2088	491	333	333
query28	3887	2376	2378	2376
query29	683	540	400	400
query30	225	187	156	156
query31	927	807	762	762
query32	74	59	60	59
query33	554	335	294	294
query34	787	832	484	484
query35	803	827	718	718
query36	939	968	895	895
query37	117	99	72	72
query38	4077	4154	4048	4048
query39	1458	1380	1362	1362
query40	212	108	99	99
query41	53	50	48	48
query42	122	105	104	104
query43	486	496	456	456
query44	1265	774	765	765
query45	169	176	159	159
query46	841	1020	637	637
query47	1750	1775	1766	1766
query48	388	409	299	299
query49	787	483	426	426
query50	714	710	419	419
query51	4188	4145	4168	4145
query52	110	113	97	97
query53	227	251	183	183
query54	479	485	403	403
query55	87	79	80	79
query56	270	248	238	238
query57	1116	1096	1069	1069
query58	246	229	238	229
query59	2624	2677	2658	2658
query60	269	285	264	264
query61	117	121	116	116
query62	797	758	664	664
query63	225	186	189	186
query64	4234	975	631	631
query65	3211	3103	3114	3103
query66	1088	390	296	296
query67	15727	15414	15090	15090
query68	7235	751	487	487
query69	462	294	259	259
query70	1173	1113	1097	1097
query71	422	293	268	268
query72	5715	3545	3628	3545
query73	740	710	338	338
query74	9343	9107	8814	8814
query75	3147	3148	2690	2690
query76	3296	1147	730	730
query77	479	424	277	277
query78	9895	9988	9286	9286
query79	2779	816	594	594
query80	583	520	444	444
query81	504	279	240	240
query82	702	125	95	95
query83	177	175	149	149
query84	237	92	79	79
query85	777	337	310	310
query86	379	306	281	281
query87	4434	4628	4358	4358
query88	3898	2160	2157	2157
query89	394	315	282	282
query90	1857	188	187	187
query91	135	140	104	104
query92	69	61	58	58
query93	2008	1018	565	565
query94	711	428	302	302
query95	351	262	252	252
query96	477	563	265	265
query97	2782	2871	2743	2743
query98	229	207	201	201
query99	1306	1393	1377	1377
Total cold run time: 271961 ms
Total hot run time: 183004 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.07	0.04	0.03
query3	0.23	0.07	0.06
query4	1.62	0.10	0.10
query5	0.43	0.41	0.40
query6	1.19	0.67	0.65
query7	0.03	0.01	0.02
query8	0.04	0.03	0.03
query9	0.60	0.52	0.55
query10	0.57	0.58	0.58
query11	0.15	0.10	0.10
query12	0.15	0.10	0.11
query13	0.62	0.61	0.60
query14	2.70	2.74	2.68
query15	0.93	0.84	0.85
query16	0.38	0.39	0.38
query17	1.05	1.08	1.03
query18	0.22	0.19	0.19
query19	1.86	1.86	1.94
query20	0.01	0.01	0.01
query21	15.36	0.91	0.53
query22	0.75	1.22	0.72
query23	14.87	1.37	0.66
query24	8.85	3.64	0.55
query25	0.31	0.14	0.08
query26	0.93	0.18	0.15
query27	0.04	0.05	0.04
query28	6.06	0.77	0.43
query29	12.53	3.84	3.28
query30	0.25	0.09	0.07
query31	2.82	0.59	0.39
query32	3.24	0.55	0.46
query33	2.99	2.97	3.01
query34	15.77	5.14	4.50
query35	4.52	4.53	4.50
query36	0.65	0.49	0.49
query37	0.08	0.06	0.06
query38	0.04	0.04	0.04
query39	0.03	0.03	0.02
query40	0.17	0.14	0.13
query41	0.08	0.03	0.03
query42	0.04	0.02	0.03
query43	0.04	0.03	0.03
Total cold run time: 103.3 s
Total hot run time: 30.35 s

@LiBinfeng-01
Copy link
Collaborator Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17605	5288	5119	5119
q2	2049	296	163	163
q3	10422	1208	713	713
q4	10205	996	523	523
q5	7539	2313	2347	2313
q6	186	165	132	132
q7	885	733	590	590
q8	9291	1303	1056	1056
q9	4870	4806	4660	4660
q10	6832	2290	1891	1891
q11	485	279	262	262
q12	337	351	219	219
q13	17774	3648	3084	3084
q14	241	231	229	229
q15	516	472	471	471
q16	621	603	587	587
q17	548	864	337	337
q18	6973	6548	6242	6242
q19	1212	953	573	573
q20	306	309	195	195
q21	2795	2229	1898	1898
q22	359	334	302	302
Total cold run time: 102051 ms
Total hot run time: 31559 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5160	5119	5075	5075
q2	238	326	232	232
q3	2136	2695	2316	2316
q4	1479	1811	1346	1346
q5	4262	4149	4154	4149
q6	218	167	125	125
q7	1887	1820	1663	1663
q8	2584	2678	2596	2596
q9	7250	7189	7110	7110
q10	3018	3193	2810	2810
q11	579	515	493	493
q12	680	794	695	695
q13	3349	3943	3293	3293
q14	278	303	287	287
q15	507	483	455	455
q16	636	681	652	652
q17	1128	1624	1351	1351
q18	7357	7328	7207	7207
q19	798	785	835	785
q20	1982	2002	1890	1890
q21	5472	5007	4756	4756
q22	648	570	537	537
Total cold run time: 51646 ms
Total hot run time: 49823 ms

@doris-robot
Copy link

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

query1	1305	967	956	956
query2	6253	1850	1831	1831
query3	11072	4581	4577	4577
query4	55289	25704	23270	23270
query5	5197	587	476	476
query6	340	203	191	191
query7	4894	523	294	294
query8	341	253	239	239
query9	6061	2494	2504	2494
query10	424	303	268	268
query11	15382	15350	15115	15115
query12	166	111	112	111
query13	1071	523	390	390
query14	10935	6864	7209	6864
query15	228	222	202	202
query16	7249	691	475	475
query17	2365	1402	649	649
query18	3272	427	323	323
query19	491	200	179	179
query20	170	123	133	123
query21	737	124	106	106
query22	4657	4402	4523	4402
query23	34202	33312	33339	33312
query24	5645	2464	2463	2463
query25	448	474	391	391
query26	732	278	159	159
query27	2053	488	340	340
query28	3018	2434	2393	2393
query29	640	562	425	425
query30	212	190	156	156
query31	899	863	796	796
query32	76	63	61	61
query33	451	344	336	336
query34	766	869	507	507
query35	798	835	764	764
query36	994	1016	910	910
query37	130	101	72	72
query38	4334	4358	4138	4138
query39	1517	1444	1471	1444
query40	214	119	101	101
query41	54	52	50	50
query42	132	110	103	103
query43	511	508	481	481
query44	1287	798	787	787
query45	186	177	167	167
query46	926	1086	675	675
query47	1835	1829	1781	1781
query48	379	443	334	334
query49	713	525	441	441
query50	714	764	437	437
query51	4326	4290	4208	4208
query52	107	102	98	98
query53	241	280	189	189
query54	492	525	422	422
query55	86	80	80	80
query56	281	289	280	280
query57	1140	1190	1126	1126
query58	253	245	253	245
query59	2789	2722	2628	2628
query60	283	281	265	265
query61	119	122	115	115
query62	734	737	697	697
query63	241	233	208	208
query64	2127	1015	678	678
query65	3386	3288	3187	3187
query66	838	395	295	295
query67	16073	15483	15262	15262
query68	5454	774	506	506
query69	509	295	258	258
query70	1228	1149	1070	1070
query71	405	293	264	264
query72	6176	3763	3866	3763
query73	1197	771	342	342
query74	8970	9071	8700	8700
query75	3196	3160	2689	2689
query76	3881	1190	770	770
query77	430	368	291	291
query78	9971	9922	9312	9312
query79	2618	831	600	600
query80	659	536	506	506
query81	492	274	248	248
query82	330	125	94	94
query83	177	173	163	163
query84	272	92	74	74
query85	760	349	300	300
query86	369	310	275	275
query87	4472	4443	4374	4374
query88	3642	2157	2149	2149
query89	402	308	290	290
query90	1696	191	195	191
query91	136	140	104	104
query92	72	62	57	57
query93	2515	1011	566	566
query94	692	432	297	297
query95	344	271	251	251
query96	490	572	271	271
query97	2856	2845	2741	2741
query98	236	201	196	196
query99	1302	1392	1311	1311
Total cold run time: 301230 ms
Total hot run time: 190565 ms

@doris-robot
Copy link

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

query1	0.04	0.06	0.03
query2	0.06	0.04	0.03
query3	0.23	0.07	0.06
query4	1.63	0.10	0.11
query5	0.42	0.42	0.39
query6	1.17	0.65	0.67
query7	0.02	0.02	0.02
query8	0.04	0.04	0.04
query9	0.60	0.51	0.53
query10	0.58	0.57	0.58
query11	0.15	0.11	0.11
query12	0.15	0.11	0.11
query13	0.61	0.60	0.61
query14	2.70	2.71	2.68
query15	0.92	0.86	0.84
query16	0.39	0.38	0.37
query17	0.98	1.01	1.02
query18	0.21	0.18	0.19
query19	1.92	1.75	2.02
query20	0.01	0.01	0.01
query21	15.36	0.92	0.56
query22	0.74	1.14	0.61
query23	15.08	1.40	0.63
query24	11.74	1.01	0.39
query25	0.39	0.24	0.09
query26	0.87	0.18	0.14
query27	0.05	0.05	0.05
query28	6.34	0.77	0.44
query29	12.58	3.88	3.22
query30	0.24	0.08	0.06
query31	2.83	0.57	0.38
query32	3.21	0.55	0.46
query33	2.93	3.08	3.01
query34	15.81	5.15	4.56
query35	4.51	4.59	4.55
query36	0.67	0.49	0.48
query37	0.09	0.06	0.06
query38	0.06	0.04	0.04
query39	0.02	0.02	0.02
query40	0.17	0.14	0.13
query41	0.08	0.03	0.03
query42	0.03	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 106.67 s
Total hot run time: 30.02 s

Copy link

@aytrack aytrack 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 anyone and no changes requested.

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

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

@morrySnow morrySnow merged commit cba955c into apache:master Feb 19, 2025
28 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 19, 2025
…o match with be execution behavior (#47966)

### What problem does this PR solve?

Related PR: #40744#47228

Problem Summary:
When numeric function input or output out of boundary when fe folding
constant, it would throw an exception before. Now
we change it to match with be execution result, which is NullLiteral
lzyy2024 pushed a commit to lzyy2024/doris that referenced this pull request Feb 21, 2025
…o match with be execution behavior (apache#47966)

### What problem does this PR solve?

Related PR: apache#40744apache#47228

Problem Summary:
When numeric function input or output out of boundary when fe folding
constant, it would throw an exception before. Now
we change it to match with be execution result, which is NullLiteral
LiBinfeng-01 added a commit to LiBinfeng-01/doris that referenced this pull request Feb 24, 2025
…o match with be execution behavior (apache#47966)

Related PR: apache#40744apache#47228

Problem Summary:
When numeric function input or output out of boundary when fe folding
constant, it would throw an exception before. Now
we change it to match with be execution result, which is NullLiteral
LiBinfeng-01 added a commit to LiBinfeng-01/doris that referenced this pull request Feb 25, 2025
…o match with be execution behavior (apache#47966)

### What problem does this PR solve?

Related PR: apache#40744apache#47228

Problem Summary:
When numeric function input or output out of boundary when fe folding
constant, it would throw an exception before. Now
we change it to match with be execution result, which is NullLiteral
yiguolei pushed a commit that referenced this pull request Feb 25, 2025
…y behavior to match with be execution behavior #47966 (#48237)

pick:#47966

Related PR: #40744#47228

Problem Summary:
When numeric function input or output out of boundary when fe folding
constant, it would throw an exception before. Now
we change it to match with be execution result, which is NullLiteral

### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

### Release note

None

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] 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 <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
dataroaring pushed a commit that referenced this pull request Feb 26, 2025
…y behavior to match with be execution behavior (#47966) (#48281)

pick:#47966
### What problem does this PR solve?

Related PR: #40744#47228

Problem Summary:
When numeric function input or output out of boundary when fe folding
constant, it would throw an exception before. Now
we change it to match with be execution result, which is NullLiteral
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 reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants