Skip to content

[Feature](functions) add brokers tvf function to query broker cluster info#60323

Open
heguanhui wants to merge 1 commit into
apache:masterfrom
heguanhui:feature/support-brokers-table-value-function
Open

[Feature](functions) add brokers tvf function to query broker cluster info#60323
heguanhui wants to merge 1 commit into
apache:masterfrom
heguanhui:feature/support-brokers-table-value-function

Conversation

@heguanhui

@heguanhui heguanhui commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

add brokers tvf function to query broker cluster info

1、same performance as show broker command
2、same performance as show proc '/brokers' command

  • 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
Copy Markdown
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?

@heguanhui heguanhui force-pushed the feature/support-brokers-table-value-function branch from 6a762b4 to 524c19c Compare January 29, 2026 19:07
@heguanhui heguanhui changed the title [Feature](functions) add brokers tvf function and unify brokers title names with show broker command [Feature](functions) add brokers tvf function to query broker cluster info Jan 29, 2026
@heguanhui

Copy link
Copy Markdown
Contributor Author

run buildall

@heguanhui heguanhui force-pushed the feature/support-brokers-table-value-function branch from 524c19c to 9fce5e8 Compare January 29, 2026 19:11
@heguanhui

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.28% (1787/2254)
Line Coverage 64.71% (31839/49203)
Region Coverage 65.45% (15881/24264)
Branch Coverage 56.03% (8441/15066)

@doris-robot

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

------ Round 1 ----------------------------------
q1	17622	5259	5093	5093
q2	1992	332	192	192
q3	10538	1323	742	742
q4	10339	833	312	312
q5	9703	2173	1915	1915
q6	229	184	148	148
q7	896	727	621	621
q8	9284	1395	1092	1092
q9	5230	4925	4810	4810
q10	6859	1912	1580	1580
q11	514	299	296	296
q12	387	383	218	218
q13	17781	4053	3215	3215
q14	247	229	235	229
q15	908	823	822	822
q16	688	673	613	613
q17	808	805	486	486
q18	7004	6937	7306	6937
q19	1477	1101	630	630
q20	410	361	237	237
q21	2883	2231	2029	2029
q22	367	312	282	282
Total cold run time: 106166 ms
Total hot run time: 32499 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5771	5500	5455	5455
q2	256	369	277	277
q3	2454	2905	2474	2474
q4	1437	1958	1485	1485
q5	4524	4710	4686	4686
q6	219	174	146	146
q7	2029	2111	1751	1751
q8	2577	2448	2435	2435
q9	7789	7622	7399	7399
q10	2835	2986	2613	2613
q11	544	462	454	454
q12	671	748	600	600
q13	3823	4025	3201	3201
q14	268	279	262	262
q15	833	799	789	789
q16	646	682	630	630
q17	1105	1301	1341	1301
q18	7307	7416	7214	7214
q19	800	805	790	790
q20	1989	2038	1904	1904
q21	4645	4251	4097	4097
q22	584	538	508	508
Total cold run time: 53106 ms
Total hot run time: 50471 ms

@doris-robot

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

query1	0.06	0.05	0.05
query2	0.13	0.07	0.06
query3	0.32	0.08	0.08
query4	1.61	0.10	0.10
query5	0.27	0.27	0.24
query6	1.15	0.64	0.64
query7	0.03	0.03	0.03
query8	0.08	0.06	0.05
query9	0.57	0.51	0.50
query10	0.55	0.56	0.55
query11	0.26	0.12	0.13
query12	0.26	0.14	0.14
query13	0.62	0.62	0.61
query14	0.98	0.98	0.97
query15	0.90	0.83	0.82
query16	0.39	0.38	0.38
query17	1.05	1.05	1.02
query18	0.24	0.22	0.21
query19	1.89	1.79	1.86
query20	0.03	0.01	0.01
query21	15.38	0.28	0.23
query22	4.98	0.10	0.10
query23	15.44	0.40	0.22
query24	2.34	0.49	0.33
query25	0.10	0.10	0.10
query26	0.18	0.17	0.17
query27	0.09	0.09	0.09
query28	3.67	1.12	0.95
query29	12.52	3.99	3.23
query30	0.31	0.12	0.10
query31	2.79	0.66	0.43
query32	3.24	0.62	0.49
query33	2.96	3.04	3.06
query34	15.96	5.04	4.49
query35	4.47	4.51	4.40
query36	0.61	0.49	0.48
query37	0.26	0.09	0.09
query38	0.21	0.06	0.06
query39	0.07	0.05	0.05
query40	0.19	0.18	0.16
query41	0.12	0.06	0.07
query42	0.08	0.05	0.04
query43	0.08	0.08	0.07
Total cold run time: 97.44 s
Total hot run time: 27.75 s

@doris-robot

Copy link
Copy Markdown

BE UT Coverage Report

Increment line coverage 0.00% (0/16) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.71% (19263/36543)
Line Coverage 36.10% (178992/495792)
Region Coverage 32.52% (138678/426419)
Branch Coverage 33.48% (60058/179358)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 0.00% (0/16) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.46% (25597/35821)
Line Coverage 54.08% (267439/494559)
Region Coverage 51.44% (221555/430737)
Branch Coverage 53.01% (95453/180074)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 77.42% (48/62) 🎉
Increment coverage report
Complete coverage report

@yx-keith

Copy link
Copy Markdown
Contributor

run buildall

@doris-robot

Copy link
Copy Markdown

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.28% (1787/2254)
Line Coverage 64.71% (31841/49203)
Region Coverage 65.45% (15882/24264)
Branch Coverage 56.01% (8438/15066)

@doris-robot

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

------ Round 1 ----------------------------------
q1	17627	5327	5123	5123
q2	1999	352	191	191
q3	10495	1291	741	741
q4	10352	864	327	327
q5	9335	2179	1896	1896
q6	218	190	154	154
q7	882	748	612	612
q8	9267	1410	1101	1101
q9	5504	4809	4855	4809
q10	6861	1964	1561	1561
q11	505	282	291	282
q12	381	373	220	220
q13	17789	4057	3256	3256
q14	246	233	232	232
q15	899	829	808	808
q16	661	691	621	621
q17	657	862	429	429
q18	6851	6632	6581	6581
q19	1204	994	593	593
q20	395	353	236	236
q21	2622	1950	1932	1932
q22	353	315	274	274
Total cold run time: 105103 ms
Total hot run time: 31979 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5387	5293	5286	5286
q2	262	340	247	247
q3	2180	2693	2243	2243
q4	1348	1732	1324	1324
q5	4288	4128	4524	4128
q6	260	201	155	155
q7	2248	2014	1881	1881
q8	2623	2416	2430	2416
q9	7569	7580	7434	7434
q10	2819	3125	2737	2737
q11	552	473	466	466
q12	681	760	610	610
q13	4080	4354	3479	3479
q14	304	314	305	305
q15	861	822	807	807
q16	679	744	690	690
q17	1137	1294	1363	1294
q18	8277	8065	7870	7870
q19	823	803	801	801
q20	1975	2036	1946	1946
q21	4591	4263	3982	3982
q22	555	566	528	528
Total cold run time: 53499 ms
Total hot run time: 50629 ms

@doris-robot

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

query1	0.06	0.05	0.05
query2	0.13	0.06	0.07
query3	0.33	0.08	0.08
query4	1.61	0.10	0.09
query5	0.26	0.25	0.26
query6	1.14	0.66	0.65
query7	0.03	0.03	0.03
query8	0.08	0.06	0.06
query9	0.57	0.51	0.50
query10	0.56	0.56	0.56
query11	0.25	0.13	0.13
query12	0.27	0.14	0.14
query13	0.62	0.62	0.60
query14	0.99	0.97	0.98
query15	0.89	0.81	0.82
query16	0.40	0.38	0.39
query17	1.03	1.03	1.06
query18	0.24	0.23	0.22
query19	1.89	1.79	1.76
query20	0.02	0.02	0.01
query21	15.42	0.29	0.23
query22	4.94	0.09	0.09
query23	15.38	0.39	0.22
query24	2.31	0.52	0.33
query25	0.10	0.09	0.10
query26	0.18	0.17	0.17
query27	0.10	0.09	0.09
query28	3.52	1.13	0.97
query29	12.51	3.99	3.21
query30	0.32	0.12	0.10
query31	2.81	0.67	0.43
query32	3.24	0.63	0.49
query33	3.02	3.06	3.09
query34	16.41	5.14	4.47
query35	4.52	4.52	4.46
query36	0.62	0.49	0.49
query37	0.26	0.09	0.09
query38	0.20	0.06	0.06
query39	0.08	0.06	0.05
query40	0.22	0.17	0.16
query41	0.13	0.06	0.06
query42	0.07	0.05	0.05
query43	0.08	0.07	0.06
Total cold run time: 97.81 s
Total hot run time: 27.81 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/16) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.49% (19272/36717)
Line Coverage 35.98% (179087/497797)
Region Coverage 32.40% (138966/428862)
Branch Coverage 33.34% (60099/180282)

@heguanhui heguanhui force-pushed the feature/support-brokers-table-value-function branch from 7147271 to fc86655 Compare January 30, 2026 12:54
@heguanhui

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

Copy link
Copy Markdown

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.29% (1792/2260)
Line Coverage 64.60% (31865/49323)
Region Coverage 65.35% (15887/24309)
Branch Coverage 55.89% (8440/15100)

@doris-robot

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

------ Round 1 ----------------------------------
q1	17706	5373	5164	5164
q2	2007	317	217	217
q3	10660	1381	743	743
q4	10330	844	319	319
q5	9497	2201	1932	1932
q6	228	184	153	153
q7	907	771	619	619
q8	9270	1413	1221	1221
q9	5559	4872	4988	4872
q10	6852	1945	1574	1574
q11	513	288	291	288
q12	392	386	232	232
q13	17870	4063	3308	3308
q14	235	236	219	219
q15	910	810	824	810
q16	685	669	631	631
q17	650	800	520	520
q18	7480	6444	6435	6435
q19	1104	1002	646	646
q20	401	364	240	240
q21	2745	2143	1993	1993
q22	361	326	277	277
Total cold run time: 106362 ms
Total hot run time: 32413 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5351	5304	5329	5304
q2	256	342	252	252
q3	2221	2691	2323	2323
q4	1372	1818	1327	1327
q5	4328	4186	5040	4186
q6	257	205	152	152
q7	2177	2034	1878	1878
q8	2672	2497	2468	2468
q9	7501	7653	7493	7493
q10	2815	3052	2584	2584
q11	544	498	483	483
q12	717	776	667	667
q13	4329	4319	3759	3759
q14	287	311	286	286
q15	888	844	844	844
q16	692	747	704	704
q17	1236	1418	1439	1418
q18	8232	7791	7968	7791
q19	944	885	922	885
q20	2181	2253	2028	2028
q21	4740	4378	4142	4142
q22	593	566	517	517
Total cold run time: 54333 ms
Total hot run time: 51491 ms

@doris-robot

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

query1	0.05	0.04	0.04
query2	0.12	0.07	0.06
query3	0.30	0.08	0.08
query4	1.60	0.10	0.10
query5	0.26	0.25	0.25
query6	1.14	0.65	0.65
query7	0.03	0.03	0.02
query8	0.07	0.06	0.06
query9	0.60	0.51	0.50
query10	0.56	0.55	0.56
query11	0.26	0.13	0.14
query12	0.26	0.14	0.15
query13	0.63	0.61	0.60
query14	0.99	0.96	0.98
query15	0.90	0.83	0.82
query16	0.39	0.38	0.40
query17	1.00	1.06	1.00
query18	0.24	0.22	0.22
query19	1.85	1.90	1.79
query20	0.02	0.01	0.02
query21	15.41	0.29	0.24
query22	5.01	0.10	0.10
query23	15.39	0.41	0.23
query24	2.41	0.52	0.32
query25	0.10	0.09	0.09
query26	0.18	0.18	0.18
query27	0.10	0.10	0.10
query28	3.66	1.12	0.96
query29	12.53	3.98	3.23
query30	0.31	0.13	0.11
query31	2.81	0.67	0.44
query32	3.25	0.63	0.50
query33	3.07	3.04	3.01
query34	16.13	5.07	4.41
query35	4.41	4.42	4.37
query36	0.60	0.50	0.49
query37	0.25	0.08	0.08
query38	0.20	0.06	0.06
query39	0.08	0.05	0.05
query40	0.21	0.18	0.17
query41	0.13	0.07	0.06
query42	0.08	0.04	0.04
query43	0.09	0.07	0.06
Total cold run time: 97.68 s
Total hot run time: 27.66 s

@heguanhui

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

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

------ Round 1 ----------------------------------
q1	17614	5397	5116	5116
q2	2018	344	199	199
q3	10202	1311	760	760
q4	10213	835	334	334
q5	7518	2118	1912	1912
q6	197	182	151	151
q7	874	737	606	606
q8	9266	1433	1130	1130
q9	5168	4787	4869	4787
q10	6770	1937	1561	1561
q11	500	286	273	273
q12	339	383	231	231
q13	17809	4013	3231	3231
q14	245	246	227	227
q15	899	825	805	805
q16	676	667	618	618
q17	636	774	545	545
q18	6845	6412	7438	6412
q19	1264	1040	678	678
q20	415	369	252	252
q21	2967	2293	2145	2145
q22	393	368	286	286
Total cold run time: 102828 ms
Total hot run time: 32259 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5437	5388	5377	5377
q2	255	326	248	248
q3	2140	2669	2251	2251
q4	1352	1727	1329	1329
q5	4236	4233	4227	4227
q6	221	181	136	136
q7	1951	1776	1680	1680
q8	2454	2264	2261	2261
q9	7025	6890	6972	6890
q10	2593	2833	2377	2377
q11	520	467	435	435
q12	626	696	576	576
q13	3764	4029	3246	3246
q14	272	291	258	258
q15	838	789	787	787
q16	635	681	647	647
q17	1086	1324	1314	1314
q18	7492	7252	7397	7252
q19	838	823	834	823
q20	1987	2066	1897	1897
q21	4485	4179	4042	4042
q22	572	558	514	514
Total cold run time: 50779 ms
Total hot run time: 48567 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.29% (1792/2260)
Line Coverage 64.60% (31865/49323)
Region Coverage 65.37% (15891/24309)
Branch Coverage 55.88% (8438/15100)

@doris-robot

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

query1	0.06	0.04	0.04
query2	0.13	0.06	0.06
query3	0.30	0.07	0.08
query4	1.62	0.10	0.11
query5	0.26	0.25	0.24
query6	1.15	0.64	0.64
query7	0.03	0.03	0.03
query8	0.07	0.06	0.06
query9	0.58	0.50	0.49
query10	0.56	0.55	0.55
query11	0.26	0.13	0.14
query12	0.26	0.14	0.14
query13	0.62	0.61	0.61
query14	0.98	0.98	0.96
query15	0.91	0.81	0.82
query16	0.40	0.38	0.39
query17	1.03	1.01	1.06
query18	0.24	0.22	0.22
query19	1.94	1.81	1.86
query20	0.03	0.01	0.01
query21	15.39	0.29	0.24
query22	5.04	0.10	0.10
query23	15.41	0.39	0.23
query24	2.43	0.51	0.36
query25	0.10	0.09	0.11
query26	0.18	0.17	0.17
query27	0.10	0.09	0.10
query28	3.52	1.14	0.97
query29	12.52	4.03	3.26
query30	0.32	0.12	0.12
query31	2.79	0.68	0.45
query32	3.23	0.63	0.50
query33	3.03	3.06	3.01
query34	15.86	5.12	4.44
query35	4.41	4.53	4.59
query36	0.61	0.50	0.48
query37	0.26	0.09	0.09
query38	0.22	0.06	0.06
query39	0.08	0.05	0.05
query40	0.20	0.17	0.17
query41	0.13	0.06	0.06
query42	0.08	0.06	0.05
query43	0.08	0.07	0.06
Total cold run time: 97.42 s
Total hot run time: 27.94 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 3.23% (2/62) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/16) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.49% (19272/36717)
Line Coverage 35.97% (179075/497797)
Region Coverage 32.40% (138970/428862)
Branch Coverage 33.33% (60081/180282)

@heguanhui

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.29% (1792/2260)
Line Coverage 64.62% (31872/49323)
Region Coverage 65.39% (15896/24309)
Branch Coverage 55.89% (8440/15100)

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 25.74 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 76db63e11f563c29c180f75cf7ad470ad147a453, data reload: false

query1	0.01	0.01	0.01
query2	0.15	0.08	0.11
query3	0.44	0.24	0.24
query4	1.61	0.25	0.26
query5	0.33	0.31	0.32
query6	1.16	0.67	0.67
query7	0.03	0.01	0.00
query8	0.09	0.07	0.07
query9	0.55	0.38	0.38
query10	0.57	0.58	0.57
query11	0.32	0.17	0.18
query12	0.32	0.19	0.19
query13	0.51	0.53	0.51
query14	0.91	0.91	0.92
query15	0.67	0.58	0.58
query16	0.39	0.40	0.38
query17	0.98	0.96	1.00
query18	0.30	0.29	0.29
query19	1.89	1.77	1.80
query20	0.03	0.01	0.01
query21	15.39	0.40	0.32
query22	4.63	0.14	0.13
query23	15.85	0.50	0.30
query24	2.45	0.58	0.43
query25	0.15	0.11	0.11
query26	0.77	0.27	0.21
query27	0.10	0.10	0.10
query28	3.60	0.90	0.54
query29	12.46	4.43	3.50
query30	0.39	0.26	0.26
query31	2.76	0.64	0.34
query32	3.24	0.61	0.48
query33	2.96	3.04	3.00
query34	15.71	4.09	3.36
query35	3.28	3.25	3.25
query36	0.63	0.53	0.50
query37	0.13	0.09	0.10
query38	0.08	0.06	0.07
query39	0.08	0.07	0.06
query40	0.21	0.18	0.17
query41	0.13	0.08	0.07
query42	0.08	0.05	0.06
query43	0.08	0.07	0.06
Total cold run time: 96.42 s
Total hot run time: 25.74 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 53.23% (33/62) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 0.00% (0/16) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.00% (29082/39838)
Line Coverage 56.60% (314538/555729)
Region Coverage 53.26% (262666/493192)
Branch Coverage 54.21% (115117/212339)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 77.42% (48/62) 🎉
Increment coverage report
Complete coverage report

@heguanhui heguanhui force-pushed the feature/support-brokers-table-value-function branch 3 times, most recently from 19b7c92 to 7baf965 Compare July 5, 2026 22:22
@heguanhui

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17585	4018	4034	4018
q2	2036	319	196	196
q3	10276	1395	813	813
q4	4690	466	337	337
q5	7568	845	576	576
q6	180	169	139	139
q7	780	853	622	622
q8	9346	1551	1573	1551
q9	5629	4471	4427	4427
q10	6731	1775	1533	1533
q11	504	347	312	312
q12	744	560	429	429
q13	18077	3407	2713	2713
q14	262	258	231	231
q15	q16	783	784	710	710
q17	1064	1056	933	933
q18	6785	5884	5620	5620
q19	1283	1270	1047	1047
q20	764	619	532	532
q21	5819	2665	2443	2443
q22	438	371	309	309
Total cold run time: 101344 ms
Total hot run time: 29491 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4421	4323	4288	4288
q2	298	321	214	214
q3	4562	5052	4350	4350
q4	2071	2153	1387	1387
q5	4468	4382	4339	4339
q6	231	181	126	126
q7	1734	1903	1737	1737
q8	2658	2290	2255	2255
q9	7831	7819	7846	7819
q10	4702	4659	4220	4220
q11	604	463	404	404
q12	754	752	546	546
q13	3479	3571	2927	2927
q14	334	310	272	272
q15	q16	746	745	689	689
q17	1398	1388	1362	1362
q18	8229	7360	6937	6937
q19	1107	1079	1084	1079
q20	2225	2200	1959	1959
q21	5311	4722	4522	4522
q22	529	490	422	422
Total cold run time: 57692 ms
Total hot run time: 51854 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.39% (1896/2450)
Line Coverage 64.45% (34072/52862)
Region Coverage 64.89% (17540/27032)
Branch Coverage 54.08% (9405/17390)

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 173353 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 7baf9654dd000e3366a12434e50d91018b051464, data reload: false

query5	4322	633	481	481
query6	483	225	203	203
query7	4842	585	341	341
query8	350	188	178	178
query9	8750	4007	4103	4007
query10	495	353	283	283
query11	5915	2373	2168	2168
query12	155	105	103	103
query13	1261	590	412	412
query14	6651	5306	5002	5002
query14_1	4333	4323	4335	4323
query15	206	198	188	188
query16	991	451	436	436
query17	1101	685	569	569
query18	2728	483	347	347
query19	200	183	144	144
query20	115	111	107	107
query21	232	155	134	134
query22	13607	13586	13337	13337
query23	17417	16488	16153	16153
query23_1	16319	16168	16210	16168
query24	7414	1706	1305	1305
query24_1	1314	1315	1295	1295
query25	533	448	369	369
query26	1312	346	216	216
query27	2690	588	361	361
query28	4395	1971	2006	1971
query29	1085	599	510	510
query30	331	250	229	229
query31	1139	1116	987	987
query32	113	65	71	65
query33	554	326	267	267
query34	1201	1185	642	642
query35	781	788	695	695
query36	1415	1409	1227	1227
query37	170	126	93	93
query38	1874	1700	1662	1662
query39	926	914	910	910
query39_1	875	892	896	892
query40	246	167	141	141
query41	72	71	69	69
query42	95	96	93	93
query43	328	324	282	282
query44	1455	793	770	770
query45	207	189	182	182
query46	1065	1192	747	747
query47	2415	2412	2256	2256
query48	405	405	310	310
query49	594	447	319	319
query50	1029	419	333	333
query51	4428	4421	4361	4361
query52	85	84	76	76
query53	274	277	208	208
query54	292	246	251	246
query55	77	73	80	73
query56	318	303	287	287
query57	1430	1409	1313	1313
query58	285	279	271	271
query59	1555	1610	1443	1443
query60	315	281	266	266
query61	179	172	173	172
query62	703	651	589	589
query63	251	212	208	208
query64	2572	819	649	649
query65	4879	4794	4801	4794
query66	1762	518	391	391
query67	29679	29397	29383	29383
query68	3163	1585	981	981
query69	418	300	267	267
query70	1077	990	958	958
query71	344	341	293	293
query72	2976	2606	2379	2379
query73	824	821	441	441
query74	5149	4990	4734	4734
query75	2600	2585	2213	2213
query76	2277	1186	761	761
query77	357	377	288	288
query78	12311	12482	11907	11907
query79	1443	1136	760	760
query80	1314	543	461	461
query81	546	327	284	284
query82	653	160	123	123
query83	359	318	290	290
query84	283	170	130	130
query85	995	609	507	507
query86	442	290	287	287
query87	1830	1832	1741	1741
query88	3757	2818	2746	2746
query89	457	414	360	360
query90	1952	204	195	195
query91	204	186	163	163
query92	67	60	59	59
query93	1661	1631	908	908
query94	783	381	305	305
query95	778	594	465	465
query96	1110	759	352	352
query97	2661	2666	2567	2567
query98	222	206	202	202
query99	1180	1135	1017	1017
Total cold run time: 260041 ms
Total hot run time: 173353 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 25.98 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 7baf9654dd000e3366a12434e50d91018b051464, data reload: false

query1	0.00	0.01	0.01
query2	0.15	0.09	0.09
query3	0.38	0.24	0.24
query4	1.61	0.24	0.24
query5	0.36	0.31	0.31
query6	1.15	0.67	0.67
query7	0.04	0.01	0.01
query8	0.10	0.08	0.07
query9	0.53	0.38	0.39
query10	0.59	0.60	0.58
query11	0.31	0.18	0.20
query12	0.33	0.19	0.18
query13	0.52	0.54	0.53
query14	0.93	0.92	0.91
query15	0.68	0.59	0.60
query16	0.38	0.39	0.39
query17	1.03	1.03	0.99
query18	0.30	0.30	0.29
query19	1.92	1.85	1.81
query20	0.03	0.01	0.02
query21	15.40	0.39	0.33
query22	4.73	0.14	0.13
query23	15.81	0.51	0.30
query24	2.28	0.61	0.49
query25	0.16	0.11	0.10
query26	0.78	0.27	0.22
query27	0.10	0.10	0.09
query28	3.66	0.90	0.56
query29	12.49	4.49	3.54
query30	0.40	0.27	0.26
query31	2.76	0.61	0.33
query32	3.23	0.60	0.47
query33	2.93	2.98	2.98
query34	15.88	4.11	3.35
query35	3.30	3.25	3.28
query36	0.66	0.53	0.51
query37	0.12	0.09	0.09
query38	0.08	0.06	0.06
query39	0.07	0.06	0.06
query40	0.19	0.18	0.17
query41	0.26	0.08	0.08
query42	0.09	0.06	0.06
query43	0.08	0.07	0.07
Total cold run time: 96.8 s
Total hot run time: 25.98 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 6.25% (1/16) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 74.66% (29742/39838)
Line Coverage 58.64% (325873/555729)
Region Coverage 55.49% (273666/493192)
Branch Coverage 56.70% (120406/212339)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 82.89% (63/76) 🎉
Increment coverage report
Complete coverage report

@yx-keith

yx-keith commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found several issues that should be fixed before merge.

Critical checkpoint conclusions:

  • Goal/test: The PR adds a brokers() TVF and tests, but the implementation does not fully match existing broker metadata auth or name semantics, and the tests miss important edge cases.
  • Scope: The feature is small, but it crosses broker metadata authorization and FE/BE metadata-scan compatibility boundaries.
  • Concurrency/lifecycle: No new concurrency or lifecycle state issue found; broker reads still use existing BrokerMgr paths.
  • Configuration/persistence/writes: No new configs or persisted state found.
  • Compatibility: The new metadata enum can silently return empty rows on old BEs during rolling upgrade.
  • Parallel paths: SHOW BROKER and SHOW PROC '/brokers' remain stricter than the TVF, and exact broker-name APIs conflict with the TVF's case-insensitive filter behavior.
  • Testing: Current tests cover happy paths but miss uppercase-key filtering, case-distinct broker names, auth parity, and unsupported metadata behavior.
  • Observability/performance: No separate observability or performance issue found beyond the existing metadata scan path.

Subagent conclusions: MAIN-2 came from TEST-1; MAIN-3 and MAIN-4 came from OPT-1 and OPT-2; MAIN-1 was added by the main review. Both live subagents completed convergence round 1 with NO_NEW_VALUABLE_FINDINGS for this final comment set.

User focus: no additional user-provided review focus.

Validation: static review only. This checkout lacks thirdparty/installed and thirdparty/installed/bin/protoc, so I did not run FE/BE builds or regression tests.

if (params == null) {
throw new AnalysisException("params cannot be null");
}
String originalClusterName = params.get(CLUSTER_NAME);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CLUSTER_NAME is accepted by the validation loop below, but this lookup is case-sensitive and runs before any normalization. For brokers("CLUSTER_NAME" = "missing"), originalClusterName stays null, getMetaScanRange() sends a null filter, and the scan returns all brokers instead of zero rows. The new regression case with uppercase CLUSTER_NAME does not catch this because it uses the existing test cluster and expects all three rows. Please normalize the property map before lookup, as the other metadata TVFs do, and add a case where uppercase CLUSTER_NAME must filter something out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I fixed it already.

if (StringUtils.isBlank(originalClusterName)) {
throw new AnalysisException("Invalid brokers param value: " + originalClusterName);
}
clusterName = originalClusterName.toLowerCase();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This changes the semantics of broker names from exact to case-insensitive only for the TVF. Add/drop and lookup paths preserve the broker name text and use exact map keys in BrokerMgr, so BrokerA and brokera can be distinct broker names. After this lowercasing, MetadataGenerator.brokersMetadataResult() compares with equalsIgnoreCase, so brokers("cluster_name" = "BrokerA") would return both clusters. Please preserve the original filter value and compare broker names consistently with the existing broker manager APIs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I fixed it already.

+ " only support property [" + CLUSTER_NAME + "]");
}
}
if (!Env.getCurrentEnv().getAccessManager().checkDbPriv(ConnectContext.get(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This privilege check is weaker than the existing broker metadata surfaces. SHOW BROKER gates the same BrokerMgr.getBrokersInfo() data behind global ADMIN or OPERATOR/NODE, and SHOW PROC '/brokers' requires ADMIN_OR_NODE, but this TVF only requires SELECT on internal.information_schema. New users get that information_schema SELECT in their default role, so select * from brokers() would expose broker names, hosts, ports, liveness, and errors to users who cannot run SHOW BROKER. Please align the TVF auth with the existing broker command/proc privilege before returning these rows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I fixed it already.

PAIMON = 12,
PARQUET = 13,
STREAMS = 14,
BROKERS = 15,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This new metadata type needs a compatibility gate or a failure path for mixed FE/BE versions. A new FE will build a TMetaScanRange with BROKERS and MetadataScanNode sends it to whatever query backend FederationBackendPolicy selects. If that BE is still old during rolling upgrade, it does not have the BROKERS case and MetaScanner::_fetch_metadata() takes the default path that sets EOF and returns OK, so brokers() can silently return no rows. Please either route/gate this TVF to BEs that support the new type or make unsupported metadata types fail loudly instead of succeeding with an empty result.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion. However, currently none of the other TVFs handle upgrade compatibility either. To keep consistency with existing implementations, we won’t address it separately in this PR for now. If there is a unified upgrade compatibility solution in the future, we can support it then.

@yx-keith yx-keith left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

brokersMetadataResult() is missing the ADMIN check that backends()/frontends() do in MetadataGenerator — so a SELECT-only user can read broker info here, while SHOW BROKER requires ADMIN/OPERATOR. Please add checkGlobalPriv(currentUserIdentity, PrivPredicate.ADMIN) (return empty for non-admin) as the sibling TVFs do, plus a non-admin regression case.

Also NonConcurrent Regression is red — please confirm it's unrelated before merge.

@heguanhui heguanhui force-pushed the feature/support-brokers-table-value-function branch 2 times, most recently from bc1db5a to 7461c94 Compare July 6, 2026 23:03
@heguanhui

Copy link
Copy Markdown
Contributor Author

run buildall

@heguanhui heguanhui force-pushed the feature/support-brokers-table-value-function branch from 7461c94 to ed246ba Compare July 6, 2026 23:14
@heguanhui heguanhui force-pushed the feature/support-brokers-table-value-function branch from ed246ba to 7fe7a59 Compare July 6, 2026 23:15
@heguanhui

Copy link
Copy Markdown
Contributor Author

run buildall

1 similar comment
@yx-keith

yx-keith commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

run buildall

@yx-keith

yx-keith commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review for PR #60323.

Requested changes:

  • The new brokers TVF regression test is not isolated from global broker state; see the inline comment.

Critical checkpoint conclusions:

  • Goal: the PR adds a brokers() metadata TVF across Nereids registration, catalog TVF construction, FE metadata generation, BE meta scan forwarding, thrift, and tests. The core path is present, but the regression test has a blocking isolation issue.
  • Scope: the implementation is focused on the new TVF and required metadata plumbing.
  • Concurrency/lifecycle: broker rows are read through BrokerMgr.getBrokersInfo() under the existing broker-manager lock; no new lifecycle or lock ordering issue was found.
  • Configuration/compatibility: no new config item. The mixed FE/BE metadata enum compatibility concern is already covered by existing thread 3526269320, so I did not duplicate it.
  • Parallel paths/protocol: checked Nereids binding/visitor registration, TableValuedFunctionIf, MetadataScanNode, BE MetaScanner, FE MetadataGenerator, and thrift fields. The broker-name exactness issue is already covered by existing thread 3526269314.
  • Tests: FE unit and regression coverage were added, but the regression suite currently assumes no unrelated brokers exist globally. I could not run FE/BE tests in this runner because .worktree_initialized, thirdparty/installed, and thirdparty/installed/bin/protoc are missing in the shallow checkout.
  • User focus: no additional user-provided focus was specified.

Subagent conclusions:

  • optimizer-rewrite: OPT-1 was merged as duplicate of existing thread 3526269314; no new non-duplicate optimizer/rewrite finding.
  • tests-session-config: TEST-2 was accepted as the inline comment below; TEST-1 was merged as duplicate of existing thread 3526269314.
  • Convergence Round 1 ended with both live subagents returning NO_NEW_VALUABLE_FINDINGS for the same final ledger/comment set.

def columnsExpr = String.join(",", columns)
log.info("columns expr: ${columnsExpr}")

def brokers = sql """select ${columnsExpr} from brokers()"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This makes the suite depend on the whole FE broker registry being empty before it owns any state. brokers() and show broker return global broker metadata, while other regression suites and manual/debug runs can leave unrelated broker names behind. In that case these initial size() == 0 assertions fail even though the new TVF works for this test's broker cluster. Please make the setup and assertions scoped to brokers_tvf_test_cluster: drop that name before starting, assert brokers("cluster_name" = brokerClusterName) is empty before add, and avoid asserting that the entire broker registry has no rows.

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/16) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 56.52% (23160/40974)
Line Coverage 40.08% (224588/560327)
Region Coverage 36.07% (177415/491858)
Branch Coverage 37.11% (78844/212479)

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17613	3953	3927	3927
q2	1998	358	196	196
q3	10283	1470	865	865
q4	4688	546	412	412
q5	7425	796	481	481
q6	194	189	145	145
q7	810	855	573	573
q8	10112	2049	1835	1835
q9	7656	6406	6410	6406
q10	8845	4193	3712	3712
q11	501	372	338	338
q12	753	621	464	464
q13	17853	4402	3707	3707
q14	412	401	379	379
q15	q16	511	546	426	426
q17	1076	1110	719	719
q18	6990	5731	5584	5584
q19	1204	1313	1103	1103
q20	1078	913	791	791
q21	6127	3543	3312	3312
q22	463	357	309	309
Total cold run time: 106592 ms
Total hot run time: 35684 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4317	4163	4167	4163
q2	351	385	262	262
q3	2251	2764	2207	2207
q4	2067	2179	1373	1373
q5	4543	4474	4470	4470
q6	232	183	132	132
q7	7706	7272	7103	7103
q8	2579	2451	2466	2451
q9	28661	28392	28472	28392
q10	4903	5074	4719	4719
q11	1145	892	854	854
q12	719	786	555	555
q13	4059	4441	3701	3701
q14	382	395	349	349
q15	q16	490	512	437	437
q17	2846	2822	2784	2784
q18	7687	7004	7056	7004
q19	1100	1058	1081	1058
q20	2279	2290	2002	2002
q21	11255	10458	10351	10351
q22	527	525	431	431
Total cold run time: 90099 ms
Total hot run time: 84798 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 25.68 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 7fe7a59f6e37c3c5fc84513302f18ffaf7bb1aa8, data reload: false

query1	0.01	0.01	0.00
query2	0.14	0.08	0.08
query3	0.39	0.25	0.25
query4	1.61	0.24	0.27
query5	0.32	0.32	0.32
query6	1.16	0.67	0.67
query7	0.04	0.01	0.01
query8	0.09	0.07	0.08
query9	0.53	0.38	0.38
query10	0.57	0.59	0.59
query11	0.33	0.19	0.18
query12	0.31	0.18	0.18
query13	0.53	0.52	0.52
query14	0.93	0.95	0.94
query15	0.68	0.60	0.59
query16	0.39	0.40	0.39
query17	1.02	1.03	1.03
query18	0.31	0.30	0.30
query19	1.93	1.84	1.79
query20	0.02	0.01	0.02
query21	15.40	0.39	0.31
query22	4.85	0.13	0.14
query23	15.84	0.50	0.29
query24	2.48	0.61	0.44
query25	0.16	0.11	0.11
query26	0.77	0.27	0.22
query27	0.11	0.10	0.09
query28	3.48	0.89	0.52
query29	12.51	4.19	3.27
query30	0.38	0.26	0.27
query31	2.76	0.63	0.33
query32	3.22	0.59	0.47
query33	2.92	3.07	2.92
query34	15.80	4.07	3.37
query35	3.35	3.27	3.28
query36	0.67	0.53	0.52
query37	0.13	0.10	0.10
query38	0.08	0.07	0.07
query39	0.07	0.06	0.07
query40	0.20	0.18	0.17
query41	0.13	0.09	0.09
query42	0.09	0.06	0.06
query43	0.08	0.07	0.07
Total cold run time: 96.79 s
Total hot run time: 25.68 s

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.

4 participants