Skip to content

Conversation

@linrrzqqq
Copy link
Contributor

What problem does this PR solve?

Issue Number: #48203

Related PR: #xxx

Problem Summary:

Release note

mysql> SELECT PERIOD_ADD(2512, 1);
+---------------------+
| PERIOD_ADD(2512, 1) |
+---------------------+
|              202601 |
+---------------------+

mysql> SELECT PERIOD_ADD(6901, 1);
+---------------------+
| PERIOD_ADD(6901, 1) |
+---------------------+
|              206902 |
+---------------------+

mysql> SELECT PERIOD_ADD(7001, 1);
+---------------------+
| PERIOD_ADD(7001, 1) |
+---------------------+
|              197002 |
+---------------------+

mysql> SELECT PERIOD_DIFF(2510, 2501);
+-------------------------+
| PERIOD_DIFF(2510, 2501) |
+-------------------------+
|                       9 |
+-------------------------+

mysql> SELECT PERIOD_DIFF(2501, 2510);
+-------------------------+
| PERIOD_DIFF(2501, 2510) |
+-------------------------+
|                      -9 |
+-------------------------+

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?

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@Thearas
Copy link
Contributor

Thearas commented Oct 14, 2025

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?

@linrrzqqq
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

query1	1074	444	408	408
query2	6594	1703	1665	1665
query3	6789	222	220	220
query4	26256	23517	23389	23389
query5	5291	670	492	492
query6	348	253	226	226
query7	4669	506	310	310
query8	324	274	252	252
query9	8711	2551	2571	2551
query10	572	376	294	294
query11	15393	15084	14784	14784
query12	190	122	114	114
query13	1703	571	455	455
query14	11620	9395	9215	9215
query15	277	204	180	180
query16	7796	699	514	514
query17	1655	765	624	624
query18	2051	476	351	351
query19	271	227	180	180
query20	140	129	136	129
query21	226	151	118	118
query22	4747	4718	4683	4683
query23	34732	33791	33593	33593
query24	8756	2480	2519	2480
query25	573	503	452	452
query26	1227	288	171	171
query27	2915	520	363	363
query28	4499	2225	2246	2225
query29	793	628	485	485
query30	296	238	210	210
query31	939	825	769	769
query32	98	78	76	76
query33	610	419	342	342
query34	862	1059	550	550
query35	839	888	807	807
query36	1006	1051	970	970
query37	146	116	100	100
query38	3689	3744	3616	3616
query39	1583	1569	1481	1481
query40	223	126	118	118
query41	70	59	59	59
query42	120	107	108	107
query43	486	503	478	478
query44	1316	828	813	813
query45	190	184	179	179
query46	838	1003	617	617
query47	1819	1829	1748	1748
query48	393	432	316	316
query49	777	517	407	407
query50	638	687	400	400
query51	3907	3901	3906	3901
query52	115	109	98	98
query53	240	264	188	188
query54	597	597	541	541
query55	91	84	83	83
query56	313	347	312	312
query57	1185	1191	1127	1127
query58	293	275	271	271
query59	2500	2716	2453	2453
query60	385	339	331	331
query61	163	155	157	155
query62	791	726	662	662
query63	235	193	188	188
query64	4473	1153	857	857
query65	4094	3938	3967	3938
query66	1066	448	335	335
query67	15485	15419	15086	15086
query68	8258	949	596	596
query69	506	317	295	295
query70	1330	1354	1271	1271
query71	526	342	322	322
query72	5783	4857	4801	4801
query73	680	568	355	355
query74	9270	9068	9013	9013
query75	4052	3379	2910	2910
query76	3765	1175	748	748
query77	825	403	314	314
query78	9580	9675	8858	8858
query79	2812	818	604	604
query80	710	554	500	500
query81	489	269	227	227
query82	508	161	130	130
query83	297	276	262	262
query84	318	118	91	91
query85	878	470	422	422
query86	342	339	300	300
query87	3786	3805	3653	3653
query88	2916	2284	2254	2254
query89	410	337	297	297
query90	2068	221	214	214
query91	168	167	131	131
query92	86	66	63	63
query93	1852	972	649	649
query94	698	439	351	351
query95	415	324	314	314
query96	482	589	290	290
query97	2971	2981	2898	2898
query98	229	216	212	212
query99	1473	1431	1314	1314
Total cold run time: 281546 ms
Total hot run time: 190271 ms

@doris-robot
Copy link

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

query1	0.06	0.06	0.05
query2	0.09	0.06	0.06
query3	0.25	0.09	0.09
query4	1.61	0.12	0.12
query5	0.28	0.26	0.26
query6	1.18	0.66	0.64
query7	0.03	0.03	0.02
query8	0.06	0.05	0.05
query9	0.67	0.54	0.53
query10	0.59	0.58	0.58
query11	0.17	0.11	0.11
query12	0.15	0.12	0.12
query13	0.62	0.62	0.63
query14	1.06	1.03	1.03
query15	0.87	0.85	0.87
query16	0.40	0.39	0.40
query17	1.06	1.08	1.03
query18	0.23	0.20	0.20
query19	1.95	1.91	1.79
query20	0.02	0.02	0.02
query21	15.41	0.90	0.58
query22	0.76	1.27	0.65
query23	14.88	1.39	0.70
query24	7.03	1.37	0.63
query25	0.48	0.27	0.14
query26	0.61	0.15	0.14
query27	0.07	0.06	0.05
query28	9.72	1.34	0.94
query29	12.54	3.94	3.30
query30	0.30	0.13	0.11
query31	2.83	0.59	0.38
query32	3.23	0.56	0.48
query33	3.08	3.10	3.02
query34	16.16	5.49	4.90
query35	4.94	4.94	4.93
query36	0.69	0.52	0.50
query37	0.11	0.08	0.07
query38	0.06	0.04	0.04
query39	0.04	0.03	0.03
query40	0.20	0.15	0.15
query41	0.09	0.04	0.03
query42	0.04	0.03	0.02
query43	0.04	0.03	0.04
Total cold run time: 104.66 s
Total hot run time: 30.38 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 7.32% (3/41) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 2.07% (4/193) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.53% (17755/33802)
Line Coverage 37.74% (161445/427830)
Region Coverage 32.19% (123153/382632)
Branch Coverage 33.62% (54117/160952)

return std::make_shared<DataTypeInt64>();
}

Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
Copy link
Contributor

Choose a reason for hiding this comment

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

这种const+nullable都要处理的,提取个基模板出来吧,估计有很多函数可以复用

Copy link
Contributor Author

@linrrzqqq linrrzqqq Oct 23, 2025

Choose a reason for hiding this comment

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

done.
for performance, before:

mysql> SELECT COUNT(MAKE_SET(bits, v1, v2, v3, v4, v5, v6, v7)) FROM test_make_set;
+---------------------------------------------------+
| COUNT(MAKE_SET(bits, v1, v2, v3, v4, v5, v6, v7)) |
+---------------------------------------------------+
|                                         100000000 |
+---------------------------------------------------+
1 row in set (25.88 sec)

after pr:


mysql> SELECT COUNT(MAKE_SET(bits, v1, v2, v3, v4, v5, v6, v7)) FROM test_make_set;
+---------------------------------------------------+
| COUNT(MAKE_SET(bits, v1, v2, v3, v4, v5, v6, v7)) |
+---------------------------------------------------+
|                                         100000000 |
+---------------------------------------------------+
1 row in set (20.87 sec)

@linrrzqqq linrrzqqq force-pushed the period-union branch 3 times, most recently from f1a88c0 to f1ea9d8 Compare October 22, 2025 20:35
@linrrzqqq
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 5.00% (2/40) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

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

query1	1082	432	409	409
query2	6551	1742	1700	1700
query3	6762	231	222	222
query4	26040	23398	23074	23074
query5	4425	644	504	504
query6	341	249	243	243
query7	4682	513	311	311
query8	307	304	264	264
query9	8714	2603	2632	2603
query10	483	366	290	290
query11	15872	15098	14911	14911
query12	207	123	120	120
query13	1691	578	453	453
query14	12767	9424	9362	9362
query15	240	192	179	179
query16	7768	643	515	515
query17	1625	775	615	615
query18	2779	456	383	383
query19	262	228	184	184
query20	145	132	144	132
query21	245	144	125	125
query22	4799	4936	4593	4593
query23	34930	33809	33904	33809
query24	8416	2574	2520	2520
query25	578	566	458	458
query26	1241	286	169	169
query27	2852	535	362	362
query28	4331	2250	2215	2215
query29	815	622	516	516
query30	349	236	207	207
query31	970	839	775	775
query32	89	88	80	80
query33	625	423	352	352
query34	847	880	571	571
query35	858	866	783	783
query36	970	979	868	868
query37	181	104	87	87
query38	3515	3547	3461	3461
query39	1502	1469	1416	1416
query40	219	125	116	116
query41	96	57	60	57
query42	125	107	106	106
query43	490	492	477	477
query44	1233	747	745	745
query45	183	174	179	174
query46	890	1013	646	646
query47	1786	1832	1768	1768
query48	388	449	316	316
query49	773	510	448	448
query50	648	699	408	408
query51	4031	3926	3873	3873
query52	111	108	100	100
query53	248	269	199	199
query54	600	593	538	538
query55	86	87	84	84
query56	325	327	309	309
query57	1222	1203	1133	1133
query58	288	282	283	282
query59	2646	2727	2572	2572
query60	350	352	324	324
query61	148	151	153	151
query62	800	740	688	688
query63	249	202	197	197
query64	4392	1166	838	838
query65	4081	3960	4007	3960
query66	1165	433	345	345
query67	15487	15166	15199	15166
query68	9351	889	593	593
query69	488	326	288	288
query70	1374	1300	1342	1300
query71	501	348	320	320
query72	5804	4891	4807	4807
query73	690	577	364	364
query74	8984	8870	8919	8870
query75	4479	3349	2848	2848
query76	3692	1189	747	747
query77	876	414	308	308
query78	9716	9854	8980	8980
query79	1832	837	594	594
query80	668	561	513	513
query81	509	268	233	233
query82	493	161	137	137
query83	276	268	253	253
query84	256	115	97	97
query85	890	461	514	461
query86	393	319	312	312
query87	3705	3754	3695	3695
query88	3597	2225	2214	2214
query89	394	320	299	299
query90	1990	218	216	216
query91	166	163	138	138
query92	86	67	68	67
query93	1626	993	649	649
query94	687	442	328	328
query95	412	416	320	320
query96	507	575	282	282
query97	2922	2971	2899	2899
query98	259	219	216	216
query99	1466	1370	1294	1294
Total cold run time: 283005 ms
Total hot run time: 190503 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.05
query2	0.09	0.05	0.06
query3	0.26	0.08	0.08
query4	1.61	0.12	0.11
query5	0.29	0.26	0.26
query6	1.20	0.68	0.65
query7	0.03	0.04	0.03
query8	0.05	0.05	0.05
query9	0.62	0.53	0.52
query10	0.59	0.60	0.58
query11	0.16	0.11	0.12
query12	0.15	0.12	0.12
query13	0.63	0.60	0.60
query14	1.04	1.01	1.01
query15	0.86	0.85	0.86
query16	0.39	0.39	0.40
query17	1.08	1.07	1.02
query18	0.22	0.21	0.20
query19	1.91	1.78	1.84
query20	0.02	0.01	0.01
query21	15.43	0.18	0.13
query22	5.04	0.08	0.05
query23	15.69	0.27	0.12
query24	2.34	0.62	0.45
query25	0.08	0.06	0.07
query26	0.14	0.13	0.14
query27	0.06	0.06	0.06
query28	4.22	1.15	0.94
query29	12.62	4.00	3.26
query30	0.29	0.15	0.11
query31	2.85	0.64	0.39
query32	3.23	0.54	0.47
query33	3.05	3.08	3.06
query34	15.42	5.18	4.62
query35	4.58	4.58	4.62
query36	0.68	0.51	0.50
query37	0.10	0.07	0.06
query38	0.07	0.05	0.04
query39	0.04	0.03	0.03
query40	0.17	0.15	0.14
query41	0.10	0.04	0.03
query42	0.04	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 97.54 s
Total hot run time: 27.76 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 2.72% (4/147) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.63% (17936/34080)
Line Coverage 37.88% (162715/429569)
Region Coverage 32.31% (124185/384401)
Branch Coverage 33.70% (54387/161393)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 86.39% (127/147) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.44% (23904/33462)
Line Coverage 57.86% (248743/429900)
Region Coverage 53.05% (206717/389664)
Branch Coverage 54.76% (88913/162378)

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 82.50% (33/40) 🎉
Increment coverage report
Complete coverage report

zclllyybb
zclllyybb previously approved these changes Oct 23, 2025
Copy link
Contributor

@zclllyybb zclllyybb left a comment

Choose a reason for hiding this comment

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

LGTM

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

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Oct 23, 2025
@linrrzqqq
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 5.00% (2/40) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

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

query1	1078	423	409	409
query2	6568	1722	1717	1717
query3	6757	235	236	235
query4	27386	23917	23299	23299
query5	4427	644	495	495
query6	347	255	239	239
query7	4658	512	322	322
query8	340	268	285	268
query9	8723	2611	2625	2611
query10	496	370	297	297
query11	15640	15148	14909	14909
query12	179	123	120	120
query13	1689	582	447	447
query14	11030	9328	9363	9328
query15	215	191	176	176
query16	7705	667	507	507
query17	1212	745	617	617
query18	2087	450	447	447
query19	254	231	192	192
query20	149	145	145	145
query21	226	149	131	131
query22	4907	4878	4731	4731
query23	34954	33683	33917	33683
query24	8552	2508	2545	2508
query25	607	517	490	490
query26	1421	305	165	165
query27	2828	526	370	370
query28	4359	2195	2198	2195
query29	846	696	538	538
query30	387	236	203	203
query31	949	865	769	769
query32	105	76	109	76
query33	639	384	328	328
query34	851	923	548	548
query35	831	845	781	781
query36	1020	1030	953	953
query37	137	122	90	90
query38	3712	3652	3568	3568
query39	1485	1419	1427	1419
query40	220	127	120	120
query41	61	59	56	56
query42	123	119	112	112
query43	488	515	483	483
query44	1270	769	747	747
query45	188	186	178	178
query46	902	1002	664	664
query47	1767	1819	1744	1744
query48	399	421	333	333
query49	776	540	416	416
query50	656	693	426	426
query51	3911	3892	3992	3892
query52	114	110	99	99
query53	244	270	205	205
query54	597	597	535	535
query55	88	87	90	87
query56	334	339	309	309
query57	1194	1230	1141	1141
query58	303	296	291	291
query59	2658	2682	2543	2543
query60	346	344	344	344
query61	158	165	167	165
query62	813	740	676	676
query63	235	196	194	194
query64	4448	1180	851	851
query65	4078	3980	3964	3964
query66	1103	438	328	328
query67	15632	15337	15063	15063
query68	8062	898	595	595
query69	478	340	294	294
query70	1374	1300	1287	1287
query71	475	366	325	325
query72	5888	5012	4930	4930
query73	639	586	366	366
query74	8952	9154	8723	8723
query75	4030	3399	2844	2844
query76	3535	1156	730	730
query77	818	403	309	309
query78	9706	9696	8949	8949
query79	2281	850	590	590
query80	644	558	507	507
query81	519	263	233	233
query82	486	166	140	140
query83	271	275	254	254
query84	269	109	98	98
query85	937	464	436	436
query86	390	311	299	299
query87	3702	3725	3633	3633
query88	3754	2243	2230	2230
query89	440	332	299	299
query90	1956	220	220	220
query91	167	187	150	150
query92	80	74	66	66
query93	1856	1006	651	651
query94	700	448	339	339
query95	408	327	325	325
query96	509	592	282	282
query97	2957	3002	2920	2920
query98	249	216	213	213
query99	1349	1401	1307	1307
Total cold run time: 280743 ms
Total hot run time: 190836 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.10	0.06	0.05
query3	0.26	0.08	0.08
query4	1.61	0.12	0.12
query5	0.28	0.26	0.26
query6	1.18	0.67	0.65
query7	0.04	0.03	0.03
query8	0.05	0.04	0.05
query9	0.63	0.52	0.52
query10	0.59	0.59	0.58
query11	0.17	0.11	0.12
query12	0.15	0.12	0.12
query13	0.63	0.61	0.61
query14	1.02	1.03	1.00
query15	0.86	0.84	0.87
query16	0.38	0.39	0.39
query17	1.06	1.03	1.02
query18	0.21	0.20	0.20
query19	1.89	1.82	1.79
query20	0.01	0.01	0.01
query21	15.47	0.19	0.14
query22	4.97	0.06	0.04
query23	15.64	0.26	0.10
query24	3.05	1.06	0.41
query25	0.08	0.06	0.06
query26	0.14	0.13	0.13
query27	0.07	0.06	0.05
query28	4.11	1.14	0.94
query29	12.54	3.95	3.26
query30	0.28	0.13	0.13
query31	2.84	0.59	0.39
query32	3.24	0.55	0.48
query33	3.05	3.18	3.04
query34	15.94	5.19	4.56
query35	4.58	4.57	4.56
query36	0.68	0.53	0.50
query37	0.10	0.07	0.06
query38	0.07	0.05	0.04
query39	0.04	0.03	0.03
query40	0.18	0.15	0.15
query41	0.08	0.04	0.03
query42	0.04	0.03	0.03
query43	0.05	0.03	0.03
Total cold run time: 98.42 s
Total hot run time: 27.63 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 7.26% (13/179) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.60% (17941/34106)
Line Coverage 37.85% (162779/430063)
Region Coverage 32.27% (124123/384652)
Branch Coverage 33.67% (54371/161494)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 86.03% (154/179) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.07% (23799/33488)
Line Coverage 57.45% (247273/430412)
Region Coverage 52.43% (204453/389918)
Branch Coverage 54.25% (88146/162485)

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 82.50% (33/40) 🎉
Increment coverage report
Complete coverage report

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

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

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 86.03% (154/179) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.35% (23895/33488)
Line Coverage 57.76% (248621/430412)
Region Coverage 52.85% (206091/389918)
Branch Coverage 54.57% (88661/162485)

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 82.50% (33/40) 🎉
Increment coverage report
Complete coverage report

@zclllyybb zclllyybb merged commit f66e517 into apache:master Oct 27, 2025
30 of 34 checks passed
@linrrzqqq linrrzqqq deleted the period-union branch October 27, 2025 07:18
linrrzqqq added a commit to linrrzqqq/doris that referenced this pull request Oct 31, 2025
…6945)

```text
mysql> SELECT PERIOD_ADD(2512, 1);
+---------------------+
| PERIOD_ADD(2512, 1) |
+---------------------+
|              202601 |
+---------------------+

mysql> SELECT PERIOD_ADD(6901, 1);
+---------------------+
| PERIOD_ADD(6901, 1) |
+---------------------+
|              206902 |
+---------------------+

mysql> SELECT PERIOD_ADD(7001, 1);
+---------------------+
| PERIOD_ADD(7001, 1) |
+---------------------+
|              197002 |
+---------------------+

mysql> SELECT PERIOD_DIFF(2510, 2501);
+-------------------------+
| PERIOD_DIFF(2510, 2501) |
+-------------------------+
|                       9 |
+-------------------------+

mysql> SELECT PERIOD_DIFF(2501, 2510);
+-------------------------+
| PERIOD_DIFF(2501, 2510) |
+-------------------------+
|                      -9 |
+-------------------------+
```
dwdwqfwe pushed a commit to dwdwqfwe/doris that referenced this pull request Oct 31, 2025
…6945)

```text
mysql> SELECT PERIOD_ADD(2512, 1);
+---------------------+
| PERIOD_ADD(2512, 1) |
+---------------------+
|              202601 |
+---------------------+

mysql> SELECT PERIOD_ADD(6901, 1);
+---------------------+
| PERIOD_ADD(6901, 1) |
+---------------------+
|              206902 |
+---------------------+

mysql> SELECT PERIOD_ADD(7001, 1);
+---------------------+
| PERIOD_ADD(7001, 1) |
+---------------------+
|              197002 |
+---------------------+

mysql> SELECT PERIOD_DIFF(2510, 2501);
+-------------------------+
| PERIOD_DIFF(2510, 2501) |
+-------------------------+
|                       9 |
+-------------------------+

mysql> SELECT PERIOD_DIFF(2501, 2510);
+-------------------------+
| PERIOD_DIFF(2501, 2510) |
+-------------------------+
|                      -9 |
+-------------------------+
```
yiguolei pushed a commit that referenced this pull request Nov 3, 2025
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/4.0.1-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants