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

[refactor](nereids)add NotNullableAggregateFunction as base class for all non-nullable agg functions #44671

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

starocean999
Copy link
Contributor

AlwaysNotNullable agg functions must return a non-null value if it's a scalar agg. So a new base class NotNullableAggregateFunction is introduced, all sub classes must implement resultForEmptyInput method to get the non-null value correctly

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

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

@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.

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?

@starocean999
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17593	7712	7348	7348
q2	2041	182	163	163
q3	10726	1065	1119	1065
q4	10541	734	697	697
q5	7587	2700	2716	2700
q6	241	151	152	151
q7	975	635	588	588
q8	9245	1834	1904	1834
q9	6485	6415	6404	6404
q10	6997	2315	2354	2315
q11	482	266	256	256
q12	424	222	213	213
q13	17788	3052	3000	3000
q14	258	213	214	213
q15	575	540	514	514
q16	663	593	578	578
q17	958	630	489	489
q18	7283	6711	6723	6711
q19	1369	1079	935	935
q20	474	183	178	178
q21	3968	3261	3189	3189
q22	374	320	307	307
Total cold run time: 107047 ms
Total hot run time: 39848 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7291	7336	7334	7334
q2	330	227	229	227
q3	2901	2873	2932	2873
q4	2051	1821	1856	1821
q5	5694	5651	5635	5635
q6	223	145	143	143
q7	2292	1796	1813	1796
q8	3396	3568	3502	3502
q9	8737	8816	8860	8816
q10	3592	3582	3563	3563
q11	607	512	496	496
q12	820	598	655	598
q13	10054	3264	3302	3264
q14	313	286	268	268
q15	567	523	522	522
q16	692	638	656	638
q17	1841	1646	1617	1617
q18	8269	7706	7550	7550
q19	1696	1482	1522	1482
q20	2138	1935	1869	1869
q21	5715	5458	5478	5458
q22	652	563	554	554
Total cold run time: 69871 ms
Total hot run time: 60026 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 197020 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 1e754b76bae91d315db2f294d0223e91a99cc814, data reload: false

query1	1255	964	938	938
query2	6253	2051	2034	2034
query3	11058	4205	4232	4205
query4	68274	28697	23634	23634
query5	4934	470	480	470
query6	400	184	188	184
query7	5548	298	289	289
query8	312	233	226	226
query9	8521	2741	2742	2741
query10	425	251	263	251
query11	17081	15362	15909	15362
query12	167	109	110	109
query13	1477	440	442	440
query14	10978	7511	7126	7126
query15	206	178	180	178
query16	7096	466	471	466
query17	1279	567	570	567
query18	1786	307	294	294
query19	198	152	157	152
query20	123	115	113	113
query21	205	109	105	105
query22	4693	4566	4722	4566
query23	34801	33921	34388	33921
query24	5399	2533	2431	2431
query25	505	396	385	385
query26	649	149	151	149
query27	1859	301	290	290
query28	4592	2526	2460	2460
query29	677	448	417	417
query30	214	148	152	148
query31	1000	840	849	840
query32	66	57	65	57
query33	407	287	279	279
query34	923	522	521	521
query35	893	766	748	748
query36	1093	944	977	944
query37	126	75	74	74
query38	4462	4374	4500	4374
query39	1492	1471	1458	1458
query40	199	99	103	99
query41	46	41	43	41
query42	124	103	98	98
query43	533	501	504	501
query44	1202	829	851	829
query45	185	169	167	167
query46	1147	686	701	686
query47	2086	1955	1973	1955
query48	454	328	320	320
query49	713	388	409	388
query50	823	404	395	395
query51	7504	7176	7151	7151
query52	98	87	86	86
query53	247	180	177	177
query54	504	400	395	395
query55	76	74	82	74
query56	255	242	251	242
query57	1338	1177	1142	1142
query58	219	208	218	208
query59	3295	3044	2876	2876
query60	307	245	247	245
query61	111	105	113	105
query62	806	664	664	664
query63	214	179	188	179
query64	1356	666	641	641
query65	3263	3233	3216	3216
query66	699	303	308	303
query67	16306	15765	15790	15765
query68	3433	576	581	576
query69	415	266	258	258
query70	1142	1105	1169	1105
query71	345	256	247	247
query72	6593	4338	3935	3935
query73	764	365	361	361
query74	10082	8965	9110	8965
query75	3372	2688	2661	2661
query76	1862	1086	1113	1086
query77	477	282	271	271
query78	10490	9477	9436	9436
query79	2203	620	609	609
query80	1443	423	541	423
query81	542	229	222	222
query82	1255	120	121	120
query83	252	146	143	143
query84	279	74	69	69
query85	1054	305	300	300
query86	445	303	307	303
query87	4786	4636	4735	4636
query88	3983	2233	2198	2198
query89	419	300	293	293
query90	2003	207	185	185
query91	135	102	106	102
query92	66	53	50	50
query93	3008	531	530	530
query94	934	300	299	299
query95	353	308	249	249
query96	612	281	280	280
query97	2906	2699	2712	2699
query98	222	200	197	197
query99	1611	1346	1318	1318
Total cold run time: 323023 ms
Total hot run time: 197020 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.02
query2	0.06	0.03	0.04
query3	0.24	0.06	0.07
query4	1.62	0.10	0.10
query5	0.42	0.39	0.42
query6	1.18	0.68	0.64
query7	0.02	0.02	0.01
query8	0.04	0.03	0.04
query9	0.58	0.51	0.51
query10	0.55	0.56	0.56
query11	0.14	0.10	0.11
query12	0.16	0.12	0.12
query13	0.60	0.60	0.60
query14	2.68	2.78	2.76
query15	0.90	0.84	0.83
query16	0.38	0.38	0.39
query17	1.09	1.01	1.08
query18	0.22	0.21	0.21
query19	1.95	1.87	1.96
query20	0.01	0.01	0.01
query21	15.38	0.60	0.61
query22	2.34	1.97	2.31
query23	16.94	0.91	0.81
query24	2.97	0.93	1.54
query25	0.20	0.21	0.08
query26	0.55	0.14	0.14
query27	0.03	0.04	0.04
query28	10.58	1.10	1.07
query29	12.59	3.24	3.23
query30	0.25	0.07	0.06
query31	2.86	0.38	0.38
query32	3.28	0.47	0.47
query33	2.97	3.04	3.04
query34	17.09	4.56	4.51
query35	4.59	4.56	4.56
query36	0.65	0.50	0.49
query37	0.10	0.06	0.06
query38	0.04	0.03	0.03
query39	0.03	0.02	0.02
query40	0.16	0.13	0.14
query41	0.07	0.02	0.02
query42	0.03	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 106.62 s
Total hot run time: 32.93 s

@starocean999 starocean999 marked this pull request as ready for review November 28, 2024 01:56
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 Nov 28, 2024
Copy link
Contributor

PR approved by anyone and no changes requested.

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. reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants