Skip to content

Conversation

@felixwluo
Copy link
Contributor

What problem does this PR solve?

Problem Summary:
Replace Math.abs() with bitwise AND operation in genIdByName() method

problem:

  • Math.abs(Long.MIN_VALUE) returns Long.MIN_VALUE (still negative) due to overflow
  • This violates the requirement that external db/table IDs must be >= 0
  • Could cause issues in DescriptorTable.toThrift() as mentioned in comments

fix:

  • Use bitwise AND with Long.MAX_VALUE to clear the sign bit
  • Guarantees non-negative result in range [0, Long.MAX_VALUE]
  • Better performance than Math.abs() conditional check

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?

@felixwluo
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉
Increment coverage report
Complete coverage report

@felixwluo
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17586	5460	5325	5325
q2	1915	298	196	196
q3	10283	1383	759	759
q4	10235	1066	566	566
q5	7571	2747	2639	2639
q6	201	172	136	136
q7	995	793	613	613
q8	9319	1440	1196	1196
q9	6876	5137	5250	5137
q10	7043	2447	1981	1981
q11	507	293	279	279
q12	357	397	221	221
q13	17779	3780	3080	3080
q14	252	246	226	226
q15	602	503	491	491
q16	424	437	386	386
q17	600	894	367	367
q18	7523	7197	7124	7124
q19	1238	1098	592	592
q20	361	345	231	231
q21	4349	3368	2504	2504
q22	1099	1035	968	968
Total cold run time: 107115 ms
Total hot run time: 35017 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5589	5509	5478	5478
q2	257	350	222	222
q3	2243	2807	2380	2380
q4	1444	1914	1473	1473
q5	4740	4601	4597	4597
q6	271	185	129	129
q7	2253	2070	1923	1923
q8	2929	2907	2928	2907
q9	7272	7248	7149	7149
q10	3297	3485	2960	2960
q11	627	539	485	485
q12	736	837	814	814
q13	3661	4106	3392	3392
q14	288	314	292	292
q15	579	521	499	499
q16	483	564	506	506
q17	1528	1742	1492	1492
q18	8008	7815	7578	7578
q19	826	850	832	832
q20	1964	1992	1808	1808
q21	5031	4708	4535	4535
q22	1080	1053	1012	1012
Total cold run time: 55106 ms
Total hot run time: 52463 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 185878 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 41d84d9ff93e89094946b042fac971ef1a3a1a14, data reload: false

query1	1004	390	439	390
query2	6542	1758	1790	1758
query3	6743	227	225	225
query4	26263	23617	23474	23474
query5	4367	603	472	472
query6	303	213	192	192
query7	4620	521	296	296
query8	277	226	228	226
query9	8575	2906	2901	2901
query10	500	345	290	290
query11	15836	14968	15231	14968
query12	162	112	118	112
query13	1667	559	429	429
query14	8980	5774	5826	5774
query15	216	187	169	169
query16	7301	666	482	482
query17	1209	725	605	605
query18	2004	417	323	323
query19	192	191	162	162
query20	138	116	117	116
query21	220	123	109	109
query22	4230	4089	3878	3878
query23	33757	32925	32944	32925
query24	8120	2352	2341	2341
query25	550	471	409	409
query26	1246	276	161	161
query27	2734	500	355	355
query28	4340	2258	2223	2223
query29	792	566	440	440
query30	290	241	194	194
query31	891	801	733	733
query32	87	81	70	70
query33	544	371	362	362
query34	806	852	520	520
query35	814	835	774	774
query36	988	1023	917	917
query37	120	105	81	81
query38	4042	4090	4021	4021
query39	1482	1428	1417	1417
query40	220	125	118	118
query41	62	58	53	53
query42	120	109	109	109
query43	510	509	487	487
query44	1372	869	860	860
query45	178	171	163	163
query46	864	1006	646	646
query47	1771	1816	1701	1701
query48	411	415	339	339
query49	727	490	386	386
query50	647	727	408	408
query51	4199	4134	4164	4134
query52	111	112	105	105
query53	239	276	196	196
query54	592	605	525	525
query55	87	85	86	85
query56	342	310	310	310
query57	1199	1209	1116	1116
query58	286	273	272	272
query59	2590	2752	2711	2711
query60	355	337	327	327
query61	155	123	128	123
query62	815	730	669	669
query63	223	183	188	183
query64	4291	1036	701	701
query65	4367	4213	4242	4213
query66	1148	409	325	325
query67	15493	15398	14987	14987
query68	7976	935	577	577
query69	481	333	301	301
query70	1267	1120	1115	1115
query71	519	342	319	319
query72	5339	4907	4809	4809
query73	734	634	361	361
query74	8939	9126	8979	8979
query75	3856	3098	2663	2663
query76	3720	1157	747	747
query77	789	404	322	322
query78	9648	9694	8873	8873
query79	2394	827	602	602
query80	623	552	494	494
query81	514	248	216	216
query82	482	139	112	112
query83	262	262	239	239
query84	252	107	165	107
query85	818	376	341	341
query86	392	315	309	309
query87	4322	4340	4162	4162
query88	3458	2293	2267	2267
query89	394	321	291	291
query90	1883	229	227	227
query91	139	143	118	118
query92	93	71	72	71
query93	1690	986	647	647
query94	692	489	314	314
query95	387	314	317	314
query96	493	586	280	280
query97	2652	2657	2634	2634
query98	256	228	217	217
query99	1396	1414	1304	1304
Total cold run time: 273186 ms
Total hot run time: 185878 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.04
query2	0.08	0.04	0.04
query3	0.25	0.08	0.07
query4	1.62	0.12	0.11
query5	0.46	0.42	0.40
query6	1.18	0.63	0.67
query7	0.03	0.02	0.02
query8	0.04	0.04	0.04
query9	0.60	0.54	0.52
query10	0.59	0.58	0.57
query11	0.17	0.11	0.12
query12	0.14	0.12	0.11
query13	0.64	0.60	0.61
query14	0.81	0.86	0.83
query15	0.92	0.87	0.86
query16	0.39	0.40	0.40
query17	1.05	1.10	1.06
query18	0.21	0.20	0.20
query19	2.00	1.85	1.90
query20	0.02	0.01	0.01
query21	15.36	1.00	0.60
query22	0.78	1.04	0.76
query23	14.97	1.40	0.62
query24	6.73	0.94	0.94
query25	0.54	0.22	0.08
query26	0.47	0.16	0.14
query27	0.06	0.06	0.05
query28	10.02	0.99	0.43
query29	12.66	4.03	3.28
query30	3.11	3.13	3.02
query31	2.83	0.61	0.38
query32	3.23	0.55	0.48
query33	3.13	3.04	3.18
query34	16.08	5.48	4.86
query35	4.97	4.95	4.93
query36	0.69	0.51	0.49
query37	0.10	0.07	0.07
query38	0.06	0.04	0.03
query39	0.04	0.03	0.02
query40	0.17	0.14	0.15
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: 107.39 s
Total hot run time: 32.9 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉
Increment coverage report
Complete coverage report

@felixwluo
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17626	5139	5114	5114
q2	1947	283	185	185
q3	10299	1271	700	700
q4	10214	1003	545	545
q5	7482	2433	2344	2344
q6	177	166	127	127
q7	907	734	598	598
q8	9310	1289	1119	1119
q9	6931	5026	5022	5022
q10	6883	2379	1996	1996
q11	462	283	277	277
q12	342	337	213	213
q13	17799	3606	3007	3007
q14	244	224	220	220
q15	553	473	486	473
q16	438	442	365	365
q17	589	850	352	352
q18	7903	7171	7009	7009
q19	1223	960	563	563
q20	349	340	221	221
q21	3729	3214	2357	2357
q22	1047	1016	944	944
Total cold run time: 106454 ms
Total hot run time: 33751 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5122	5136	5142	5136
q2	246	328	226	226
q3	2152	2696	2294	2294
q4	1335	1793	1327	1327
q5	4204	4448	4638	4448
q6	224	175	130	130
q7	2030	1942	1874	1874
q8	2636	2753	2644	2644
q9	7262	7450	7113	7113
q10	3177	3241	2903	2903
q11	579	507	497	497
q12	718	788	634	634
q13	3510	3890	3372	3372
q14	301	321	271	271
q15	560	489	491	489
q16	470	487	469	469
q17	1210	1615	1406	1406
q18	7809	7780	7626	7626
q19	830	890	869	869
q20	2061	2138	1905	1905
q21	4996	4399	4278	4278
q22	1079	1082	985	985
Total cold run time: 52511 ms
Total hot run time: 50896 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 184889 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 04bb3c4a5899145e61573777da5a39e1b8f6e4c1, data reload: false

query1	968	384	424	384
query2	6530	1809	1755	1755
query3	6743	232	223	223
query4	26748	23490	23377	23377
query5	4359	620	474	474
query6	310	200	195	195
query7	4632	515	284	284
query8	254	233	213	213
query9	8577	2873	2882	2873
query10	481	355	282	282
query11	15979	15031	15008	15008
query12	163	115	113	113
query13	1669	565	429	429
query14	9511	5693	5668	5668
query15	202	190	166	166
query16	7543	632	494	494
query17	1173	710	576	576
query18	2056	400	303	303
query19	188	185	159	159
query20	140	116	112	112
query21	215	121	104	104
query22	4177	4102	4033	4033
query23	33787	32789	32801	32789
query24	8142	2350	2369	2350
query25	542	481	405	405
query26	1233	271	168	168
query27	2723	504	343	343
query28	4342	2264	2234	2234
query29	765	585	479	479
query30	289	223	193	193
query31	920	798	692	692
query32	78	73	76	73
query33	553	375	337	337
query34	793	836	511	511
query35	796	824	766	766
query36	980	992	934	934
query37	121	103	88	88
query38	4039	4068	3911	3911
query39	1465	1475	1436	1436
query40	212	122	120	120
query41	58	54	56	54
query42	127	110	110	110
query43	499	504	468	468
query44	1325	848	840	840
query45	178	171	163	163
query46	854	999	638	638
query47	1768	1805	1703	1703
query48	391	425	320	320
query49	713	476	371	371
query50	641	688	382	382
query51	4029	4104	4158	4104
query52	108	107	104	104
query53	230	266	199	199
query54	592	587	519	519
query55	84	83	90	83
query56	305	307	315	307
query57	1188	1192	1124	1124
query58	279	263	269	263
query59	2651	2781	2608	2608
query60	338	353	344	344
query61	165	154	156	154
query62	846	756	665	665
query63	227	190	189	189
query64	4439	1104	785	785
query65	4305	4216	4226	4216
query66	1097	409	332	332
query67	15377	15250	15004	15004
query68	8000	920	584	584
query69	477	319	282	282
query70	1212	1141	1139	1139
query71	515	341	328	328
query72	5554	4801	4886	4801
query73	738	654	354	354
query74	8960	9086	8737	8737
query75	3876	3072	2613	2613
query76	3708	1140	732	732
query77	787	394	315	315
query78	9611	9614	8811	8811
query79	2199	850	596	596
query80	619	526	483	483
query81	468	250	224	224
query82	432	133	107	107
query83	254	293	233	233
query84	243	98	86	86
query85	806	367	330	330
query86	342	316	317	316
query87	4278	4286	4242	4242
query88	3412	2239	2267	2239
query89	392	327	291	291
query90	1957	221	210	210
query91	138	144	114	114
query92	92	71	66	66
query93	1420	1001	635	635
query94	697	411	300	300
query95	401	312	308	308
query96	500	581	284	284
query97	2668	2712	2533	2533
query98	252	227	210	210
query99	1460	1413	1283	1283
Total cold run time: 273680 ms
Total hot run time: 184889 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.04
query2	0.08	0.04	0.04
query3	0.24	0.08	0.07
query4	1.62	0.12	0.11
query5	0.42	0.42	0.42
query6	1.17	0.62	0.65
query7	0.02	0.02	0.01
query8	0.04	0.04	0.03
query9	0.60	0.52	0.51
query10	0.58	0.57	0.57
query11	0.16	0.11	0.11
query12	0.14	0.12	0.12
query13	0.63	0.60	0.60
query14	0.78	0.83	0.83
query15	0.89	0.86	0.84
query16	0.39	0.39	0.39
query17	1.07	1.08	1.02
query18	0.22	0.20	0.20
query19	1.94	1.78	1.88
query20	0.01	0.02	0.02
query21	15.42	0.98	0.59
query22	0.81	1.17	0.71
query23	14.80	1.38	0.65
query24	6.63	2.15	0.95
query25	0.44	0.14	0.06
query26	0.60	0.16	0.12
query27	0.06	0.06	0.06
query28	10.13	0.93	0.43
query29	12.65	3.91	3.23
query30	3.05	3.01	2.96
query31	2.82	0.58	0.38
query32	3.23	0.55	0.47
query33	3.04	3.11	3.13
query34	16.04	5.47	4.86
query35	4.94	4.93	4.97
query36	0.71	0.52	0.49
query37	0.09	0.07	0.06
query38	0.05	0.04	0.04
query39	0.03	0.02	0.03
query40	0.18	0.14	0.14
query41	0.09	0.03	0.02
query42	0.04	0.02	0.02
query43	0.03	0.03	0.04
Total cold run time: 106.92 s
Total hot run time: 32.66 s

@felixwluo
Copy link
Contributor Author

run p0

@felixwluo
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17633	5271	5131	5131
q2	1997	346	209	209
q3	10219	1278	729	729
q4	10219	1010	523	523
q5	7549	2392	2340	2340
q6	181	165	140	140
q7	938	784	646	646
q8	9353	1375	1086	1086
q9	6878	5091	5122	5091
q10	7003	2373	1962	1962
q11	489	313	284	284
q12	353	353	229	229
q13	17774	3636	3020	3020
q14	242	237	227	227
q15	577	495	498	495
q16	428	424	391	391
q17	601	866	360	360
q18	7413	7150	7195	7150
q19	1391	989	560	560
q20	345	362	243	243
q21	3792	2545	2341	2341
q22	1080	1034	1003	1003
Total cold run time: 106455 ms
Total hot run time: 34160 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5212	5115	5108	5108
q2	256	330	239	239
q3	2142	2628	2263	2263
q4	1332	1836	1378	1378
q5	4177	4303	4423	4303
q6	224	172	135	135
q7	2102	1949	1800	1800
q8	2675	2778	2582	2582
q9	7353	7298	7343	7298
q10	3116	3283	2926	2926
q11	592	530	517	517
q12	681	790	723	723
q13	3517	3845	3283	3283
q14	289	320	280	280
q15	523	484	486	484
q16	432	493	449	449
q17	1218	1586	1363	1363
q18	7855	7674	7560	7560
q19	863	860	847	847
q20	1898	1954	1835	1835
q21	4797	4377	4313	4313
q22	1105	1061	1024	1024
Total cold run time: 52359 ms
Total hot run time: 50710 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 186342 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 208f22050225bdb64477ceb2acc177ec8f576abe, data reload: false

query1	1056	480	402	402
query2	6583	1740	1752	1740
query3	6761	235	225	225
query4	26187	23371	22851	22851
query5	4317	609	529	529
query6	348	250	235	235
query7	4655	515	312	312
query8	318	255	238	238
query9	8667	2921	2929	2921
query10	480	339	304	304
query11	15840	15263	14731	14731
query12	174	130	123	123
query13	1673	572	441	441
query14	9811	5716	5732	5716
query15	219	198	176	176
query16	7704	662	518	518
query17	1213	725	626	626
query18	2055	436	328	328
query19	207	191	166	166
query20	129	125	124	124
query21	222	128	108	108
query22	4263	4289	4140	4140
query23	33837	32874	33031	32874
query24	8031	2424	2378	2378
query25	581	554	490	490
query26	1248	277	173	173
query27	2707	521	356	356
query28	4441	2274	2230	2230
query29	813	617	525	525
query30	294	233	196	196
query31	933	794	717	717
query32	92	87	84	84
query33	599	403	364	364
query34	794	854	530	530
query35	843	850	754	754
query36	987	1015	936	936
query37	127	111	95	95
query38	4096	4121	3994	3994
query39	1534	1455	1430	1430
query40	220	130	129	129
query41	71	70	67	67
query42	130	122	119	119
query43	534	507	501	501
query44	1339	860	869	860
query45	185	180	184	180
query46	871	1016	644	644
query47	1778	1880	1767	1767
query48	409	446	321	321
query49	728	529	417	417
query50	654	670	403	403
query51	4120	4176	4094	4094
query52	119	115	106	106
query53	245	263	199	199
query54	613	624	550	550
query55	97	88	90	88
query56	345	387	325	325
query57	1194	1218	1127	1127
query58	287	282	279	279
query59	2648	2760	2636	2636
query60	350	357	345	345
query61	165	161	161	161
query62	825	730	720	720
query63	230	200	193	193
query64	4446	1136	898	898
query65	4241	4138	4200	4138
query66	1092	445	349	349
query67	15800	15244	15113	15113
query68	8683	920	585	585
query69	497	331	292	292
query70	1253	1171	1111	1111
query71	489	361	318	318
query72	5553	4949	4873	4873
query73	726	581	361	361
query74	9104	9029	9045	9029
query75	3992	3140	2636	2636
query76	3723	1138	754	754
query77	821	402	333	333
query78	9638	9756	8890	8890
query79	2318	815	619	619
query80	638	576	573	573
query81	508	257	230	230
query82	494	138	108	108
query83	265	273	243	243
query84	274	116	86	86
query85	895	460	427	427
query86	400	316	300	300
query87	4273	4279	4119	4119
query88	3465	2245	2242	2242
query89	399	332	290	290
query90	1875	221	216	216
query91	163	161	132	132
query92	94	76	69	69
query93	1692	1040	645	645
query94	701	402	326	326
query95	413	329	328	328
query96	496	576	280	280
query97	2652	2673	2550	2550
query98	249	225	211	211
query99	1431	1418	1357	1357
Total cold run time: 276749 ms
Total hot run time: 186342 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.04
query2	0.09	0.05	0.05
query3	0.25	0.08	0.08
query4	1.60	0.11	0.12
query5	0.43	0.41	0.40
query6	1.16	0.66	0.65
query7	0.03	0.03	0.02
query8	0.05	0.04	0.05
query9	0.61	0.51	0.50
query10	0.58	0.57	0.58
query11	0.17	0.12	0.11
query12	0.14	0.12	0.12
query13	0.63	0.63	0.62
query14	0.81	0.83	0.83
query15	0.88	0.88	0.88
query16	0.39	0.41	0.39
query17	1.09	1.07	1.02
query18	0.25	0.20	0.20
query19	2.00	1.84	1.85
query20	0.02	0.01	0.01
query21	15.45	1.08	0.59
query22	0.79	1.21	0.99
query23	14.71	1.38	0.65
query24	6.65	1.40	0.89
query25	0.47	0.22	0.16
query26	0.60	0.16	0.14
query27	0.05	0.05	0.05
query28	10.14	0.93	0.42
query29	12.62	3.82	3.23
query30	3.05	3.01	2.95
query31	2.83	0.59	0.38
query32	3.27	0.55	0.48
query33	3.00	3.15	3.17
query34	15.94	5.44	4.88
query35	4.96	4.91	5.00
query36	0.70	0.51	0.50
query37	0.10	0.07	0.07
query38	0.06	0.04	0.04
query39	0.03	0.04	0.03
query40	0.18	0.15	0.15
query41	0.09	0.04	0.03
query42	0.04	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 107 s
Total hot run time: 33.22 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉
Increment coverage report
Complete coverage report

@felixwluo
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17680	5346	5141	5141
q2	1998	337	235	235
q3	10222	1284	721	721
q4	10241	1034	533	533
q5	7537	2393	2352	2352
q6	185	175	142	142
q7	942	767	652	652
q8	9374	1343	1146	1146
q9	6948	5176	5108	5108
q10	6896	2396	1994	1994
q11	494	319	282	282
q12	360	357	237	237
q13	17784	3671	3101	3101
q14	259	245	233	233
q15	544	506	502	502
q16	445	435	383	383
q17	607	854	358	358
q18	7978	7136	6960	6960
q19	1226	964	578	578
q20	355	345	231	231
q21	3998	3226	2411	2411
q22	1084	1049	996	996
Total cold run time: 107157 ms
Total hot run time: 34296 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5208	5201	5202	5201
q2	259	338	232	232
q3	2221	2704	2266	2266
q4	1390	1795	1371	1371
q5	4224	4563	4584	4563
q6	263	185	137	137
q7	2077	1967	1873	1873
q8	2678	2663	2584	2584
q9	7338	7274	7258	7258
q10	3080	3321	2964	2964
q11	598	537	501	501
q12	675	794	645	645
q13	3502	3959	3418	3418
q14	322	332	299	299
q15	549	504	482	482
q16	517	528	450	450
q17	1258	1681	1390	1390
q18	8184	7774	7492	7492
q19	854	883	981	883
q20	1951	2017	1992	1992
q21	5137	4605	4396	4396
q22	1072	1029	997	997
Total cold run time: 53357 ms
Total hot run time: 51394 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 186925 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 181b43b9fea9f03f594374c0e64c2ed7255e0708, data reload: false

query1	1034	476	417	417
query2	6567	1765	1796	1765
query3	6753	229	228	228
query4	26239	23741	23298	23298
query5	4368	655	523	523
query6	354	248	232	232
query7	4653	523	309	309
query8	321	272	255	255
query9	8681	2903	2901	2901
query10	510	347	310	310
query11	15762	15113	14894	14894
query12	181	119	120	119
query13	1676	567	431	431
query14	9504	5904	5831	5831
query15	209	193	165	165
query16	7677	639	455	455
query17	1218	757	637	637
query18	2048	430	339	339
query19	210	205	172	172
query20	136	129	123	123
query21	221	134	123	123
query22	4142	4147	4143	4143
query23	33830	33118	32829	32829
query24	8185	2380	2410	2380
query25	593	531	463	463
query26	1259	305	184	184
query27	2698	534	367	367
query28	4383	2287	2266	2266
query29	811	649	530	530
query30	301	227	200	200
query31	903	819	756	756
query32	95	86	85	85
query33	595	413	368	368
query34	811	855	528	528
query35	827	839	793	793
query36	989	1005	940	940
query37	138	124	101	101
query38	4058	4049	4060	4049
query39	1561	1441	1422	1422
query40	230	140	131	131
query41	74	67	68	67
query42	137	115	116	115
query43	515	534	484	484
query44	1342	867	864	864
query45	188	182	169	169
query46	916	1018	655	655
query47	1769	1793	1738	1738
query48	399	438	321	321
query49	755	520	423	423
query50	664	678	416	416
query51	4118	4200	4035	4035
query52	121	118	111	111
query53	249	278	203	203
query54	632	618	563	563
query55	98	91	98	91
query56	357	341	323	323
query57	1179	1195	1121	1121
query58	296	283	293	283
query59	2670	2833	2641	2641
query60	368	369	349	349
query61	168	164	161	161
query62	846	768	654	654
query63	230	205	206	205
query64	4460	1147	867	867
query65	4319	4231	4207	4207
query66	1096	432	353	353
query67	15735	15154	15089	15089
query68	8978	944	588	588
query69	493	354	288	288
query70	1281	1159	1133	1133
query71	487	346	325	325
query72	5623	4944	4826	4826
query73	723	594	360	360
query74	9158	9101	8832	8832
query75	4400	3112	2660	2660
query76	3715	1159	739	739
query77	814	437	342	342
query78	9564	9746	8835	8835
query79	2367	853	595	595
query80	671	682	556	556
query81	482	266	231	231
query82	434	142	110	110
query83	300	270	259	259
query84	312	114	92	92
query85	911	478	436	436
query86	339	321	301	301
query87	4354	4277	4134	4134
query88	3050	2250	2221	2221
query89	403	326	311	311
query90	1953	227	228	227
query91	158	171	135	135
query92	99	78	76	76
query93	1351	998	672	672
query94	698	430	334	334
query95	428	339	333	333
query96	486	581	287	287
query97	2695	2680	2585	2585
query98	244	219	221	219
query99	1452	1436	1313	1313
Total cold run time: 276855 ms
Total hot run time: 186925 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.09	0.05	0.06
query3	0.25	0.09	0.08
query4	1.61	0.12	0.12
query5	0.45	0.44	0.43
query6	1.16	0.64	0.66
query7	0.03	0.02	0.03
query8	0.06	0.04	0.05
query9	0.62	0.53	0.53
query10	0.59	0.58	0.58
query11	0.17	0.12	0.12
query12	0.15	0.12	0.12
query13	0.63	0.62	0.63
query14	0.79	0.86	0.84
query15	0.90	0.85	0.88
query16	0.41	0.41	0.41
query17	1.10	1.06	1.05
query18	0.21	0.20	0.20
query19	1.94	1.86	1.85
query20	0.02	0.01	0.01
query21	15.40	0.96	0.58
query22	0.75	1.19	0.76
query23	14.85	1.37	0.59
query24	7.21	0.80	0.81
query25	0.52	0.29	0.10
query26	0.63	0.16	0.15
query27	0.06	0.06	0.05
query28	9.60	0.93	0.42
query29	12.54	3.85	3.24
query30	3.10	3.08	3.04
query31	2.83	0.59	0.39
query32	3.23	0.55	0.49
query33	3.08	3.22	3.16
query34	15.91	5.43	4.84
query35	4.90	4.91	4.89
query36	0.70	0.51	0.49
query37	0.10	0.07	0.08
query38	0.06	0.05	0.04
query39	0.04	0.03	0.03
query40	0.18	0.15	0.14
query41	0.08	0.04	0.03
query42	0.03	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 107.08 s
Total hot run time: 32.96 s

@felixwluo
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17623	5267	5026	5026
q2	2003	313	207	207
q3	10269	1304	706	706
q4	10221	1014	525	525
q5	7556	2452	2306	2306
q6	189	166	135	135
q7	916	758	635	635
q8	9329	1340	1080	1080
q9	6988	5082	5127	5082
q10	6958	2379	1970	1970
q11	498	309	278	278
q12	363	391	227	227
q13	17769	3710	2989	2989
q14	228	243	223	223
q15	571	503	486	486
q16	421	426	379	379
q17	597	850	362	362
q18	7419	7039	6992	6992
q19	1317	936	556	556
q20	351	343	226	226
q21	3665	2551	2340	2340
q22	1057	1050	974	974
Total cold run time: 106308 ms
Total hot run time: 33704 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5185	5144	5138	5138
q2	248	367	222	222
q3	2160	2708	2338	2338
q4	1352	1728	1356	1356
q5	4168	4170	4534	4170
q6	233	183	135	135
q7	2009	1971	1873	1873
q8	2630	2561	2600	2561
q9	7470	7427	7351	7351
q10	3107	3304	2849	2849
q11	575	511	494	494
q12	731	769	682	682
q13	3523	3897	3416	3416
q14	301	319	301	301
q15	521	478	477	477
q16	462	520	485	485
q17	1180	1569	1407	1407
q18	7711	7681	7642	7642
q19	813	813	1054	813
q20	2016	2083	1910	1910
q21	4729	4367	4324	4324
q22	1077	1080	1006	1006
Total cold run time: 52201 ms
Total hot run time: 50950 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 186757 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 3c934c4551e5cb418116a297bc3f92337ddd9739, data reload: false

query1	1037	465	398	398
query2	6558	1814	1776	1776
query3	6754	232	226	226
query4	26189	23640	23335	23335
query5	4483	668	555	555
query6	345	261	240	240
query7	5409	546	318	318
query8	323	272	269	269
query9	8606	2985	2921	2921
query10	505	349	313	313
query11	15900	15012	14787	14787
query12	191	126	124	124
query13	1701	583	458	458
query14	9600	5810	5840	5810
query15	225	211	179	179
query16	7691	635	539	539
query17	1389	737	631	631
query18	2061	425	327	327
query19	205	201	171	171
query20	133	124	125	124
query21	223	133	132	132
query22	4170	4099	4097	4097
query23	33846	32853	32930	32853
query24	8122	2389	2416	2389
query25	582	513	449	449
query26	734	282	170	170
query27	2630	514	349	349
query28	4283	2268	2217	2217
query29	705	616	488	488
query30	285	225	208	208
query31	915	790	749	749
query32	94	80	81	80
query33	559	386	359	359
query34	786	841	521	521
query35	856	839	775	775
query36	982	1033	919	919
query37	135	123	101	101
query38	4037	4103	3961	3961
query39	1489	1473	1428	1428
query40	222	136	127	127
query41	74	65	64	64
query42	127	114	123	114
query43	532	499	482	482
query44	1333	866	868	866
query45	183	177	167	167
query46	870	1023	671	671
query47	1750	1858	1739	1739
query48	385	427	313	313
query49	715	514	421	421
query50	669	678	394	394
query51	4130	4119	4079	4079
query52	122	144	110	110
query53	241	267	199	199
query54	609	620	551	551
query55	94	89	90	89
query56	337	376	316	316
query57	1203	1205	1134	1134
query58	286	277	274	274
query59	2658	2717	2611	2611
query60	358	370	354	354
query61	164	161	164	161
query62	806	731	672	672
query63	232	199	191	191
query64	3205	1127	826	826
query65	4231	4201	4183	4183
query66	907	449	342	342
query67	15739	15356	15070	15070
query68	7984	925	589	589
query69	490	325	301	301
query70	1262	1138	1160	1138
query71	478	346	318	318
query72	5684	5002	5131	5002
query73	740	666	351	351
query74	8960	8841	8954	8841
query75	3848	3080	2623	2623
query76	3670	1136	744	744
query77	815	399	339	339
query78	9659	9809	8928	8928
query79	2208	837	602	602
query80	653	581	516	516
query81	489	259	230	230
query82	452	142	108	108
query83	267	262	250	250
query84	255	109	89	89
query85	936	475	428	428
query86	367	316	306	306
query87	4294	4315	4214	4214
query88	3084	2233	2194	2194
query89	395	335	305	305
query90	1937	237	223	223
query91	161	162	133	133
query92	93	81	80	80
query93	1173	991	659	659
query94	702	420	346	346
query95	427	337	328	328
query96	495	588	280	280
query97	2683	2673	2543	2543
query98	268	231	216	216
query99	1470	1394	1267	1267
Total cold run time: 273319 ms
Total hot run time: 186757 ms

@doris-robot
Copy link

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

query1	0.06	0.04	0.05
query2	0.10	0.05	0.05
query3	0.26	0.09	0.08
query4	1.60	0.11	0.12
query5	0.43	0.41	0.39
query6	1.20	0.65	0.65
query7	0.03	0.02	0.03
query8	0.05	0.04	0.05
query9	0.60	0.52	0.52
query10	0.57	0.57	0.58
query11	0.17	0.11	0.11
query12	0.16	0.12	0.12
query13	0.63	0.64	0.61
query14	0.81	0.83	0.84
query15	0.92	0.86	0.84
query16	0.40	0.41	0.40
query17	1.02	1.02	1.05
query18	0.22	0.20	0.20
query19	1.98	1.87	1.85
query20	0.02	0.01	0.02
query21	15.40	0.96	0.59
query22	0.81	1.13	0.69
query23	14.91	1.40	0.67
query24	6.72	0.92	1.76
query25	0.46	0.16	0.07
query26	0.57	0.17	0.13
query27	0.05	0.06	0.06
query28	10.19	0.94	0.44
query29	12.63	3.92	3.23
query30	3.12	3.07	3.02
query31	2.82	0.58	0.37
query32	3.24	0.56	0.48
query33	3.05	3.06	3.08
query34	15.98	5.49	4.86
query35	4.94	4.93	4.96
query36	0.68	0.51	0.50
query37	0.10	0.07	0.07
query38	0.06	0.04	0.04
query39	0.04	0.03	0.03
query40	0.19	0.15	0.15
query41	0.08	0.02	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 107.35 s
Total hot run time: 32.85 s

@felixwluo
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17595	5269	5135	5135
q2	1991	360	228	228
q3	10217	1314	738	738
q4	10238	1069	528	528
q5	7534	2445	2365	2365
q6	197	168	138	138
q7	938	767	637	637
q8	9347	1351	1145	1145
q9	7032	5140	5199	5140
q10	6891	2383	1993	1993
q11	482	308	285	285
q12	381	366	241	241
q13	17773	3635	3049	3049
q14	231	243	218	218
q15	559	497	502	497
q16	429	434	378	378
q17	595	865	379	379
q18	7460	7238	7051	7051
q19	1093	952	584	584
q20	353	349	219	219
q21	4139	3280	2391	2391
q22	1083	1050	1023	1023
Total cold run time: 106558 ms
Total hot run time: 34362 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5277	5212	5402	5212
q2	254	326	232	232
q3	2176	2682	2360	2360
q4	1420	1802	1374	1374
q5	4212	4541	4625	4541
q6	224	181	145	145
q7	2044	1954	1850	1850
q8	2679	2745	2640	2640
q9	7399	7253	7240	7240
q10	3104	3332	2900	2900
q11	590	541	523	523
q12	710	778	651	651
q13	3744	3864	3323	3323
q14	314	327	273	273
q15	559	491	493	491
q16	478	520	452	452
q17	1189	1618	1674	1618
q18	7931	7754	7597	7597
q19	880	869	894	869
q20	2031	2085	1906	1906
q21	5205	4731	4726	4726
q22	1206	1061	1027	1027
Total cold run time: 53626 ms
Total hot run time: 51950 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 187442 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 017f75c158b701680888f0e844947bac77f6392b, data reload: false

query1	1066	462	403	403
query2	6562	1829	1770	1770
query3	6752	230	223	223
query4	26111	23361	23348	23348
query5	5651	684	537	537
query6	346	268	215	215
query7	4648	521	297	297
query8	301	258	253	253
query9	8643	2908	2913	2908
query10	544	345	323	323
query11	16233	15104	15175	15104
query12	185	125	122	122
query13	1666	566	434	434
query14	10857	5904	5771	5771
query15	247	201	172	172
query16	7689	659	503	503
query17	1629	768	625	625
query18	2054	444	339	339
query19	232	200	179	179
query20	133	131	122	122
query21	219	128	124	124
query22	4102	4163	4016	4016
query23	34106	32940	33028	32940
query24	7724	2420	2448	2420
query25	621	520	453	453
query26	1222	282	166	166
query27	2709	508	368	368
query28	4420	2273	2254	2254
query29	747	605	481	481
query30	307	243	200	200
query31	897	811	749	749
query32	90	90	86	86
query33	583	400	368	368
query34	805	863	519	519
query35	879	857	751	751
query36	979	1016	906	906
query37	123	109	103	103
query38	4056	4033	3999	3999
query39	1481	1434	1462	1434
query40	230	140	128	128
query41	73	70	65	65
query42	127	116	118	116
query43	540	511	470	470
query44	1351	881	870	870
query45	182	178	172	172
query46	873	1029	656	656
query47	1761	1847	1792	1792
query48	405	458	337	337
query49	750	520	439	439
query50	644	692	404	404
query51	4089	4168	4070	4070
query52	117	115	136	115
query53	250	266	210	210
query54	622	617	535	535
query55	97	91	92	91
query56	348	336	332	332
query57	1223	1211	1147	1147
query58	294	285	284	284
query59	2628	2721	2572	2572
query60	369	360	353	353
query61	168	158	168	158
query62	832	760	692	692
query63	237	196	198	196
query64	4452	1235	877	877
query65	4279	4211	4181	4181
query66	1055	455	348	348
query67	15604	15136	15086	15086
query68	5976	946	600	600
query69	490	334	300	300
query70	1205	1159	1158	1158
query71	441	356	321	321
query72	5808	5262	5052	5052
query73	682	637	370	370
query74	9237	8958	9016	8958
query75	3151	3087	2648	2648
query76	3144	1156	767	767
query77	513	403	340	340
query78	9577	9774	8845	8845
query79	1986	870	595	595
query80	839	583	526	526
query81	492	258	236	236
query82	425	144	115	115
query83	270	259	248	248
query84	261	116	101	101
query85	873	483	441	441
query86	336	288	297	288
query87	4168	4300	4183	4183
query88	2808	2226	2250	2226
query89	402	345	298	298
query90	1823	231	232	231
query91	170	162	135	135
query92	82	77	72	72
query93	1183	1004	654	654
query94	658	472	329	329
query95	411	337	343	337
query96	497	595	290	290
query97	2659	2668	2586	2586
query98	241	224	220	220
query99	1330	1411	1291	1291
Total cold run time: 273357 ms
Total hot run time: 187442 ms

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2025

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

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

github-actions bot commented Sep 1, 2025

PR approved by anyone and no changes requested.

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 50.00% (2/4) 🎉
Increment coverage report
Complete coverage report

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

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

LGTM

@dataroaring dataroaring merged commit 6e0e241 into apache:master Sep 4, 2025
29 of 31 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 4, 2025
…ative ID generation (#55183)

### What problem does this PR solve?

Problem Summary:
`Replace Math.abs() with bitwise AND operation in genIdByName() method`

problem:
- Math.abs(Long.MIN_VALUE) returns Long.MIN_VALUE (still negative) due
to overflow
- This violates the requirement that external db/table IDs must be >= 0
- Could cause issues in DescriptorTable.toThrift() as mentioned in
comments

fix:
- Use bitwise AND with Long.MAX_VALUE to clear the sign bit
- Guarantees non-negative result in range [0, Long.MAX_VALUE]
- Better performance than Math.abs() conditional check

### 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 -->
github-actions bot pushed a commit that referenced this pull request Sep 4, 2025
…ative ID generation (#55183)

### What problem does this PR solve?

Problem Summary:
`Replace Math.abs() with bitwise AND operation in genIdByName() method`

problem:
- Math.abs(Long.MIN_VALUE) returns Long.MIN_VALUE (still negative) due
to overflow
- This violates the requirement that external db/table IDs must be >= 0
- Could cause issues in DescriptorTable.toThrift() as mentioned in
comments

fix:
- Use bitwise AND with Long.MAX_VALUE to clear the sign bit
- Guarantees non-negative result in range [0, Long.MAX_VALUE]
- Better performance than Math.abs() conditional check

### 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 -->
felixwluo added a commit to felixwluo/doris that referenced this pull request Sep 5, 2025
yiguolei pushed a commit that referenced this pull request Sep 5, 2025
…sure non-negative ID generation #55183 (#55688)

Cherry-picked from #55183

Co-authored-by: lw112 <131352377+felixwluo@users.noreply.github.com>
morrySnow pushed a commit that referenced this pull request Sep 5, 2025
…sure non-negative ID generation #55183 (#55689)

Cherry-picked from #55183

Co-authored-by: lw112 <131352377+felixwluo@users.noreply.github.com>
wenzhenghu pushed a commit to wenzhenghu/doris that referenced this pull request Sep 8, 2025
…ative ID generation (apache#55183)

### What problem does this PR solve?

Problem Summary:
`Replace Math.abs() with bitwise AND operation in genIdByName() method`

problem:
- Math.abs(Long.MIN_VALUE) returns Long.MIN_VALUE (still negative) due
to overflow
- This violates the requirement that external db/table IDs must be >= 0
- Could cause issues in DescriptorTable.toThrift() as mentioned in
comments

fix:
- Use bitwise AND with Long.MAX_VALUE to clear the sign bit
- Guarantees non-negative result in range [0, Long.MAX_VALUE]
- Better performance than Math.abs() conditional check

### 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 Sep 11, 2025
…sure non-negative ID generation #55183 (#55708)

### What problem does this PR solve?

pick: #55183
@morrySnow morrySnow mentioned this pull request Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants