Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #52042

### What problem does this PR solve?

This commit fixes an Undefined Behavior Sanitizer error triggered when
printing `PUniqueId` directly to an ostream.
Among the three types of unique IDs, `UniqueId`, `PUniqueId` (protobuf),
and `TUniqueId` (thrift),
only `UniqueId` has an overloaded `operator<<()`.
Attempting to stream the other two types leads to undefined behavior,
making the current approach error-prone.

Introduces a unified `print_id()` function for safely printing all
unique ID types (`UniqueId`, `PUniqueId`, `TUniqueId`).
It is recommended to use `print_id()` instead of streaming directly.
@github-actions github-actions bot requested a review from morrySnow as a code owner June 25, 2025 02:24
@Thearas
Copy link
Contributor

Thearas commented Jun 25, 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?

@dataroaring dataroaring reopened this Jun 25, 2025
@Thearas
Copy link
Contributor

Thearas commented Jun 25, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17597	6714	6656	6656
q2	2069	177	163	163
q3	10556	1095	1143	1095
q4	10287	781	719	719
q5	7768	2883	2865	2865
q6	218	133	130	130
q7	975	615	594	594
q8	9358	1935	1986	1935
q9	6590	6423	6464	6423
q10	7033	2251	2298	2251
q11	464	253	255	253
q12	396	210	206	206
q13	17812	3003	2960	2960
q14	234	201	211	201
q15	520	465	458	458
q16	479	374	374	374
q17	995	580	578	578
q18	7546	6688	6616	6616
q19	1329	1040	1060	1040
q20	469	204	203	203
q21	3930	3193	3153	3153
q22	1078	986	957	957
Total cold run time: 107703 ms
Total hot run time: 39830 ms

----- Round 2, with runtime_filter_mode=off -----
q1	6591	6614	6572	6572
q2	329	230	230	230
q3	2907	2784	2817	2784
q4	2013	1788	1798	1788
q5	5794	5736	5777	5736
q6	207	124	125	124
q7	2239	1770	1825	1770
q8	3381	3560	3530	3530
q9	8975	8737	8909	8737
q10	3541	3572	3525	3525
q11	586	517	500	500
q12	839	584	608	584
q13	10086	3159	3116	3116
q14	299	278	280	278
q15	512	456	470	456
q16	484	439	462	439
q17	1853	1639	1609	1609
q18	8248	7895	7924	7895
q19	1704	1593	1609	1593
q20	2169	1871	1810	1810
q21	5112	4908	4955	4908
q22	1112	1074	1018	1018
Total cold run time: 68981 ms
Total hot run time: 59002 ms

@doris-robot
Copy link

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

query1	1292	906	925	906
query2	6316	1860	1865	1860
query3	10778	4321	4196	4196
query4	61580	28987	23493	23493
query5	5175	462	440	440
query6	397	175	174	174
query7	5415	307	309	307
query8	308	218	213	213
query9	8626	2586	2585	2585
query10	462	282	266	266
query11	17505	15223	15674	15223
query12	164	104	105	104
query13	1441	444	427	427
query14	9989	6610	7580	6610
query15	191	181	180	180
query16	7075	499	470	470
query17	1156	615	578	578
query18	1810	324	329	324
query19	199	159	151	151
query20	114	112	108	108
query21	216	102	101	101
query22	4567	4408	4602	4408
query23	34551	34109	34109	34109
query24	6172	2902	2917	2902
query25	522	411	405	405
query26	657	164	159	159
query27	1762	345	349	345
query28	4035	2157	2130	2130
query29	676	440	432	432
query30	237	153	160	153
query31	991	801	823	801
query32	66	59	59	59
query33	439	297	299	297
query34	914	502	522	502
query35	847	744	699	699
query36	1076	923	955	923
query37	106	64	67	64
query38	4067	3987	3937	3937
query39	1490	1479	1461	1461
query40	213	103	101	101
query41	50	47	50	47
query42	117	107	102	102
query43	517	482	482	482
query44	1189	830	832	830
query45	191	168	177	168
query46	1181	757	761	757
query47	1999	1926	1907	1907
query48	443	338	355	338
query49	755	406	402	402
query50	848	438	440	438
query51	7394	7284	7234	7234
query52	105	93	102	93
query53	272	189	183	183
query54	575	496	485	485
query55	88	85	80	80
query56	304	251	259	251
query57	1304	1207	1240	1207
query58	234	232	228	228
query59	3200	3066	2939	2939
query60	297	271	278	271
query61	136	147	144	144
query62	797	695	677	677
query63	222	183	192	183
query64	1396	718	651	651
query65	3327	3199	3185	3185
query66	702	301	284	284
query67	15908	15492	15388	15388
query68	4274	597	602	597
query69	448	267	265	265
query70	1151	1153	1045	1045
query71	354	254	255	254
query72	6428	3999	3947	3947
query73	754	346	359	346
query74	10536	9158	9246	9158
query75	3371	2638	2683	2638
query76	2017	1153	1153	1153
query77	488	270	293	270
query78	10614	9586	9634	9586
query79	1761	604	594	594
query80	1436	426	425	425
query81	512	222	221	221
query82	1288	95	90	90
query83	279	149	142	142
query84	284	117	82	82
query85	1033	308	299	299
query86	386	294	295	294
query87	4436	4245	4224	4224
query88	3890	2382	2369	2369
query89	415	292	297	292
query90	1997	188	187	187
query91	139	116	118	116
query92	67	48	51	48
query93	2246	555	546	546
query94	780	306	262	262
query95	363	255	259	255
query96	613	290	277	277
query97	3326	3149	3167	3149
query98	214	210	199	199
query99	1596	1338	1320	1320
Total cold run time: 314644 ms
Total hot run time: 196207 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.02
query2	0.07	0.03	0.03
query3	0.23	0.06	0.07
query4	1.62	0.10	0.11
query5	0.51	0.51	0.51
query6	1.13	0.72	0.72
query7	0.02	0.01	0.01
query8	0.04	0.03	0.03
query9	0.54	0.50	0.50
query10	0.56	0.57	0.56
query11	0.14	0.11	0.10
query12	0.14	0.12	0.11
query13	0.61	0.59	0.59
query14	0.77	0.79	0.81
query15	0.83	0.83	0.82
query16	0.40	0.39	0.40
query17	1.02	1.00	1.01
query18	0.23	0.21	0.21
query19	1.88	1.78	1.82
query20	0.01	0.01	0.01
query21	15.40	0.58	0.59
query22	2.98	1.50	1.40
query23	16.86	0.85	0.80
query24	3.07	1.69	2.05
query25	0.19	0.16	0.09
query26	0.60	0.14	0.14
query27	0.04	0.04	0.05
query28	8.91	0.53	0.46
query29	12.60	3.29	3.26
query30	0.25	0.06	0.06
query31	2.84	0.39	0.39
query32	3.23	0.46	0.45
query33	2.99	2.97	3.00
query34	17.02	4.49	4.45
query35	4.51	4.48	4.50
query36	0.65	0.48	0.47
query37	0.09	0.06	0.06
query38	0.04	0.04	0.03
query39	0.04	0.02	0.02
query40	0.17	0.13	0.12
query41	0.08	0.02	0.03
query42	0.04	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 103.43 s
Total hot run time: 30.37 s

@morrySnow morrySnow merged commit 752faab into branch-3.1 Jun 25, 2025
21 of 22 checks passed
@morrySnow morrySnow deleted the auto-pick-52042-branch-3.1 branch June 25, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants