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

[Feature](function) Support function quarters_add/sub for nereids #45370

Merged
merged 3 commits into from
Dec 26, 2024

Conversation

zclllyybb
Copy link
Contributor

@zclllyybb zclllyybb commented Dec 12, 2024

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

  1. BE already has its implementation. now add nereids function signatures.
mysql> select quarters_add("2020-12-12", 1);
+-----------------------------------------------+
| quarters_add(cast('2020-12-12' as DATEV2), 1) |
+-----------------------------------------------+
| 2021-03-12                                    |
+-----------------------------------------------+
1 row in set (0.10 sec)

mysql> select date_sub("2020-12-12", interval 10 quarter);
+------------------------------------------------+
| quarters_sub(cast('2020-12-12' as DATEV2), 10) |
+------------------------------------------------+
| 2018-06-12                                     |
+------------------------------------------------+
1 row in set (0.11 sec)
  1. for date operations' template implementations in BE, we choose years_add to cover its standard testcases to test the base template.

Release note

Support function quarters_add/sub

Check List (For Author)

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?

@zclllyybb
Copy link
Contributor Author

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 38.74% (10102/26074)
Line Coverage: 29.68% (84739/285551)
Region Coverage: 28.73% (43485/151345)
Branch Coverage: 25.29% (22090/87340)
Coverage Report: http://coverage.selectdb-in.cc/coverage/83b49a837dd7db77fd884fe15ea3ed8094d3261c_83b49a837dd7db77fd884fe15ea3ed8094d3261c/report/index.html

@zclllyybb zclllyybb marked this pull request as draft December 16, 2024 11:17
@zclllyybb
Copy link
Contributor Author

wait #45265 merged. then add some testcase

@zclllyybb zclllyybb marked this pull request as ready for review December 25, 2024 08:45
@zclllyybb
Copy link
Contributor Author

run buildall

zhangstar333
zhangstar333 previously approved these changes Dec 25, 2024
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Dec 25, 2024
Copy link
Contributor

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

Copy link
Contributor

PR approved by anyone and no changes requested.

@zclllyybb
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17587	6098	6000	6000
q2	2043	283	173	173
q3	10433	1227	703	703
q4	10208	848	423	423
q5	7539	2127	1925	1925
q6	198	179	149	149
q7	870	737	604	604
q8	9236	1324	1122	1122
q9	5167	4967	4962	4962
q10	6737	2316	1841	1841
q11	489	288	261	261
q12	353	365	216	216
q13	17762	3521	2948	2948
q14	230	234	212	212
q15	556	520	492	492
q16	633	625	585	585
q17	558	840	323	323
q18	7101	6469	6500	6469
q19	1845	960	556	556
q20	299	317	189	189
q21	2731	2107	1971	1971
q22	362	327	305	305
Total cold run time: 102937 ms
Total hot run time: 32429 ms

----- Round 2, with runtime_filter_mode=off -----
q1	6238	6188	6184	6184
q2	230	322	230	230
q3	2204	2633	2307	2307
q4	1398	1806	1364	1364
q5	4337	4693	4664	4664
q6	186	178	141	141
q7	2132	2007	1837	1837
q8	2531	2752	2679	2679
q9	7268	7145	7226	7145
q10	3061	3319	2829	2829
q11	576	524	486	486
q12	665	777	632	632
q13	3409	3725	3069	3069
q14	294	294	277	277
q15	566	510	513	510
q16	636	693	638	638
q17	1198	1709	1231	1231
q18	7734	7262	7219	7219
q19	745	984	1080	984
q20	1899	1968	1823	1823
q21	5370	5108	4885	4885
q22	608	596	583	583
Total cold run time: 53285 ms
Total hot run time: 51717 ms

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 38.80% (10095/26016)
Line Coverage: 29.81% (85233/285938)
Region Coverage: 28.92% (43515/150445)
Branch Coverage: 25.46% (22187/87132)
Coverage Report: http://coverage.selectdb-in.cc/coverage/ca16dc2254c589c26c4c8238077403751b71eaa7_ca16dc2254c589c26c4c8238077403751b71eaa7/report/index.html

@doris-robot
Copy link

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

query1	978	373	375	373
query2	6527	2364	2352	2352
query3	6705	214	214	214
query4	33991	23611	23779	23611
query5	4374	598	465	465
query6	287	197	188	188
query7	4618	492	306	306
query8	307	273	235	235
query9	9389	2731	2738	2731
query10	470	316	247	247
query11	18207	15244	15034	15034
query12	158	105	103	103
query13	1677	541	413	413
query14	11037	6827	7191	6827
query15	223	205	186	186
query16	8210	579	445	445
query17	1587	749	563	563
query18	2076	426	288	288
query19	206	175	147	147
query20	114	108	107	107
query21	209	122	100	100
query22	4377	4287	4418	4287
query23	34287	33060	34044	33060
query24	6457	2210	2197	2197
query25	438	442	391	391
query26	1076	245	154	154
query27	2028	445	322	322
query28	5164	2481	2452	2452
query29	522	520	408	408
query30	225	192	147	147
query31	987	900	791	791
query32	71	65	56	56
query33	513	351	279	279
query34	782	830	508	508
query35	776	828	740	740
query36	1014	1049	947	947
query37	115	121	76	76
query38	4228	4278	4188	4188
query39	1507	1445	1400	1400
query40	206	120	100	100
query41	45	45	47	45
query42	120	103	101	101
query43	508	519	487	487
query44	1290	806	793	793
query45	183	172	163	163
query46	859	1033	640	640
query47	1955	1939	1866	1866
query48	369	404	312	312
query49	770	465	386	386
query50	617	636	389	389
query51	7248	7189	7095	7095
query52	99	97	91	91
query53	214	249	184	184
query54	466	469	401	401
query55	79	82	84	82
query56	257	263	230	230
query57	1185	1209	1135	1135
query58	238	220	248	220
query59	3149	3352	2937	2937
query60	262	252	257	252
query61	110	105	107	105
query62	877	793	742	742
query63	217	186	195	186
query64	4176	988	641	641
query65	3268	3242	3241	3241
query66	1045	425	302	302
query67	15959	15783	15361	15361
query68	9454	752	518	518
query69	481	293	242	242
query70	1208	1135	1106	1106
query71	439	283	250	250
query72	5686	3831	3782	3782
query73	823	756	364	364
query74	9899	9114	8817	8817
query75	4581	3134	2644	2644
query76	5630	1181	735	735
query77	998	361	256	256
query78	9951	10149	9847	9847
query79	3776	876	581	581
query80	752	523	425	425
query81	471	262	231	231
query82	228	144	128	128
query83	193	163	142	142
query84	278	93	75	75
query85	747	352	303	303
query86	327	325	303	303
query87	4733	4651	4537	4537
query88	3358	2262	2284	2262
query89	410	331	305	305
query90	2055	187	187	187
query91	131	145	113	113
query92	70	56	49	49
query93	2033	890	537	537
query94	666	397	280	280
query95	335	261	250	250
query96	479	619	277	277
query97	2851	2773	2688	2688
query98	220	203	203	203
query99	1638	1552	1446	1446
Total cold run time: 296589 ms
Total hot run time: 189708 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.07	0.04	0.04
query3	0.23	0.07	0.07
query4	1.61	0.10	0.10
query5	0.44	0.41	0.39
query6	1.18	0.66	0.65
query7	0.02	0.01	0.01
query8	0.04	0.04	0.03
query9	0.57	0.51	0.48
query10	0.55	0.58	0.55
query11	0.15	0.11	0.11
query12	0.15	0.11	0.11
query13	0.61	0.61	0.60
query14	2.73	2.76	2.74
query15	0.92	0.82	0.81
query16	0.39	0.39	0.40
query17	0.99	1.04	1.01
query18	0.23	0.22	0.22
query19	1.95	1.89	2.00
query20	0.01	0.00	0.01
query21	15.35	0.91	0.60
query22	0.75	0.74	0.64
query23	15.32	1.43	0.60
query24	3.89	1.20	2.00
query25	0.25	0.13	0.11
query26	0.25	0.15	0.14
query27	0.05	0.05	0.04
query28	14.29	1.65	1.06
query29	12.57	3.96	3.26
query30	0.25	0.10	0.06
query31	2.84	0.61	0.39
query32	3.24	0.56	0.47
query33	3.17	3.10	3.18
query34	16.58	5.07	4.48
query35	4.49	4.46	4.50
query36	0.63	0.49	0.47
query37	0.10	0.06	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.16	0.13	0.12
query41	0.08	0.03	0.02
query42	0.03	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 107.28 s
Total hot run time: 31.63 s

@zhangstar333 zhangstar333 merged commit d5e967c into apache:master Dec 26, 2024
26 of 27 checks passed
@zclllyybb zclllyybb deleted the quarters_add branch December 26, 2024 08:43
HappenLee pushed a commit to apache/doris-website that referenced this pull request Jan 2, 2025
)

pr: apache/doris#45370
## Versions 

- [x] dev
- [x] 3.0
- [ ] 2.1
- [ ] 2.0

## Languages

- [x] Chinese
- [x] English

## Docs Checklist

- [ ] Checked by AI
- [ ] Test Cases Built
echo-hhj pushed a commit to echo-hhj/doris-website that referenced this pull request Jan 6, 2025
…ache#1654)

pr: apache/doris#45370
## Versions 

- [x] dev
- [x] 3.0
- [ ] 2.1
- [ ] 2.0

## Languages

- [x] Chinese
- [x] English

## Docs Checklist

- [ ] Checked by AI
- [ ] Test Cases Built
daveyyan pushed a commit to daveyyan/doris-website that referenced this pull request Jan 8, 2025
…ache#1654)

pr: apache/doris#45370
## Versions 

- [x] dev
- [x] 3.0
- [ ] 2.1
- [ ] 2.0

## Languages

- [x] Chinese
- [x] English

## Docs Checklist

- [ ] Checked by AI
- [ ] Test Cases Built
daveyyan pushed a commit to daveyyan/doris-website that referenced this pull request Jan 15, 2025
…ache#1654)

pr: apache/doris#45370
## Versions 

- [x] dev
- [x] 3.0
- [ ] 2.1
- [ ] 2.0

## Languages

- [x] Chinese
- [x] English

## Docs Checklist

- [ ] Checked by AI
- [ ] Test Cases Built
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/3.0.x dev/3.0.x-conflict reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants