Skip to content

Conversation

@zy-kkk
Copy link
Member

@zy-kkk zy-kkk commented Nov 6, 2025

When using query() to query two different catalogs in a single SQL statement, due to the hard-coded tableid, the BE will assume that all scanNodes are querying the same table. This will cause scanner reuse, resulting in different catalogs using the same JDBC connection.

@Thearas
Copy link
Contributor

Thearas commented Nov 6, 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?

@zy-kkk
Copy link
Member Author

zy-kkk commented Nov 6, 2025

run buildall

@doris-robot
Copy link

TPC-DS: Total hot run time: 189570 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 97f30484140a16b2ba22ca7cc0af6a0d5c8bceec, data reload: false

query1	1062	403	396	396
query2	6548	1744	1754	1744
query3	6750	231	226	226
query4	26132	23264	23468	23264
query5	5223	636	458	458
query6	341	248	244	244
query7	4667	501	299	299
query8	309	263	261	261
query9	8689	2597	2554	2554
query10	532	344	290	290
query11	15710	14992	14804	14804
query12	188	120	114	114
query13	1692	571	444	444
query14	11673	9241	9182	9182
query15	196	191	172	172
query16	7657	703	529	529
query17	1339	748	613	613
query18	2021	427	362	362
query19	241	213	214	213
query20	137	131	132	131
query21	400	132	128	128
query22	4822	4674	4698	4674
query23	34915	33957	33927	33927
query24	8933	2507	2529	2507
query25	695	554	476	476
query26	1231	281	160	160
query27	2803	511	356	356
query28	4418	2249	2241	2241
query29	798	627	524	524
query30	316	242	195	195
query31	925	826	743	743
query32	77	70	71	70
query33	605	376	335	335
query34	864	901	533	533
query35	838	847	792	792
query36	986	967	898	898
query37	119	109	86	86
query38	3510	3560	3470	3470
query39	1484	1422	1383	1383
query40	221	122	112	112
query41	58	59	59	59
query42	122	107	108	107
query43	479	495	479	479
query44	1217	731	737	731
query45	182	180	176	176
query46	879	978	636	636
query47	1770	1788	1729	1729
query48	400	422	310	310
query49	774	507	415	415
query50	632	670	395	395
query51	3881	3945	3896	3896
query52	108	107	97	97
query53	226	273	209	209
query54	308	295	261	261
query55	84	82	80	80
query56	325	317	296	296
query57	1171	1185	1097	1097
query58	280	277	271	271
query59	2518	2640	2562	2562
query60	340	332	330	330
query61	164	162	158	158
query62	789	751	667	667
query63	231	195	191	191
query64	4447	1187	872	872
query65	4033	3945	3949	3945
query66	1086	436	360	360
query67	15410	15149	15098	15098
query68	7747	870	600	600
query69	499	326	297	297
query70	1370	1296	1290	1290
query71	446	343	312	312
query72	6335	5079	4929	4929
query73	638	580	358	358
query74	9102	8943	8592	8592
query75	3337	3390	2854	2854
query76	3281	1143	752	752
query77	516	378	312	312
query78	9714	9678	8933	8933
query79	2781	843	590	590
query80	1565	560	505	505
query81	568	255	229	229
query82	737	154	127	127
query83	269	255	247	247
query84	256	109	89	89
query85	947	473	436	436
query86	470	335	286	286
query87	3794	3718	3631	3631
query88	4004	2218	2219	2218
query89	393	322	293	293
query90	1991	214	214	214
query91	165	165	134	134
query92	83	65	64	64
query93	2573	986	632	632
query94	797	419	356	356
query95	396	324	315	315
query96	482	579	275	275
query97	2892	2961	2865	2865
query98	240	210	207	207
query99	1348	1408	1291	1291
Total cold run time: 281717 ms
Total hot run time: 189570 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.08	0.05	0.05
query3	0.25	0.08	0.08
query4	1.61	0.11	0.11
query5	0.27	0.25	0.25
query6	1.17	0.65	0.64
query7	0.03	0.03	0.03
query8	0.05	0.04	0.04
query9	0.60	0.52	0.53
query10	0.58	0.58	0.59
query11	0.16	0.12	0.11
query12	0.14	0.12	0.12
query13	0.62	0.60	0.60
query14	1.01	1.00	1.00
query15	0.85	0.84	0.84
query16	0.40	0.39	0.40
query17	1.04	1.05	1.02
query18	0.22	0.20	0.20
query19	1.90	1.81	1.81
query20	0.01	0.00	0.01
query21	15.43	0.22	0.13
query22	4.98	0.07	0.05
query23	15.73	0.27	0.10
query24	2.27	0.99	0.76
query25	0.08	0.06	0.05
query26	0.14	0.14	0.13
query27	0.07	0.05	0.06
query28	4.70	1.15	0.94
query29	12.54	3.89	3.23
query30	0.28	0.14	0.11
query31	2.82	0.60	0.37
query32	3.22	0.54	0.48
query33	3.08	2.96	3.03
query34	15.83	5.17	4.56
query35	4.57	4.61	4.59
query36	0.66	0.48	0.49
query37	0.09	0.07	0.07
query38	0.06	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.15	0.14
query41	0.09	0.03	0.03
query42	0.04	0.03	0.02
query43	0.04	0.04	0.03
Total cold run time: 97.99 s
Total hot run time: 27.79 s

@zy-kkk
Copy link
Member Author

zy-kkk commented Nov 6, 2025

run buildall

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 80.00% (4/5) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

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

query1	1046	395	408	395
query2	6556	1705	1724	1705
query3	6753	219	219	219
query4	26369	24268	23512	23512
query5	5602	607	471	471
query6	315	231	208	208
query7	5256	491	290	290
query8	295	266	233	233
query9	8720	2557	2555	2555
query10	533	323	278	278
query11	15488	15226	14906	14906
query12	190	119	115	115
query13	1663	542	424	424
query14	11400	9111	9102	9102
query15	197	189	171	171
query16	7648	681	512	512
query17	1590	756	646	646
query18	2056	449	359	359
query19	214	209	179	179
query20	160	140	136	136
query21	294	138	115	115
query22	4540	4855	4533	4533
query23	34589	34239	33920	33920
query24	8682	2518	2528	2518
query25	598	577	480	480
query26	1393	272	180	180
query27	2749	519	344	344
query28	4673	2223	2212	2212
query29	856	671	557	557
query30	293	261	216	216
query31	940	842	740	740
query32	91	76	83	76
query33	613	416	337	337
query34	823	881	539	539
query35	856	878	811	811
query36	989	983	903	903
query37	114	114	85	85
query38	3475	3488	3529	3488
query39	1448	1390	1392	1390
query40	223	128	119	119
query41	63	61	60	60
query42	120	110	111	110
query43	478	478	480	478
query44	1204	744	745	744
query45	187	179	171	171
query46	889	988	642	642
query47	1780	1793	1689	1689
query48	400	433	316	316
query49	782	498	430	430
query50	630	701	402	402
query51	3928	4055	3832	3832
query52	114	110	104	104
query53	238	264	209	209
query54	310	302	291	291
query55	93	85	83	83
query56	328	318	325	318
query57	1185	1203	1124	1124
query58	296	277	286	277
query59	2545	2634	2559	2559
query60	357	359	332	332
query61	192	176	156	156
query62	781	724	670	670
query63	223	188	187	187
query64	4434	1131	837	837
query65	4010	3958	3954	3954
query66	1031	445	338	338
query67	15519	15050	15008	15008
query68	8409	862	588	588
query69	512	327	288	288
query70	1298	1272	1336	1272
query71	468	339	321	321
query72	6073	4880	4952	4880
query73	637	604	363	363
query74	8964	8834	8853	8834
query75	3415	3457	2874	2874
query76	3404	1140	732	732
query77	541	417	315	315
query78	9490	9794	9002	9002
query79	1805	834	587	587
query80	703	543	497	497
query81	520	258	223	223
query82	239	158	127	127
query83	272	261	239	239
query84	259	116	88	88
query85	860	465	424	424
query86	358	301	289	289
query87	3690	3639	3637	3637
query88	2856	2272	2226	2226
query89	378	348	286	286
query90	1997	213	214	213
query91	165	162	134	134
query92	79	64	57	57
query93	1860	1001	638	638
query94	696	458	314	314
query95	392	319	311	311
query96	488	575	278	278
query97	2881	2971	2893	2893
query98	232	213	206	206
query99	1347	1458	1284	1284
Total cold run time: 277695 ms
Total hot run time: 189720 ms

@doris-robot
Copy link

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

query1	0.05	0.06	0.05
query2	0.09	0.05	0.05
query3	0.26	0.09	0.08
query4	1.60	0.11	0.11
query5	0.27	0.25	0.24
query6	1.17	0.65	0.63
query7	0.04	0.03	0.03
query8	0.05	0.04	0.04
query9	0.61	0.53	0.51
query10	0.58	0.57	0.57
query11	0.16	0.12	0.11
query12	0.15	0.13	0.12
query13	0.61	0.61	0.60
query14	0.99	1.01	1.00
query15	0.85	0.83	0.84
query16	0.40	0.39	0.39
query17	1.02	1.00	1.02
query18	0.21	0.20	0.22
query19	1.97	1.86	1.75
query20	0.02	0.01	0.01
query21	15.40	0.21	0.12
query22	5.05	0.06	0.05
query23	15.67	0.26	0.11
query24	3.28	0.48	0.38
query25	0.08	0.06	0.05
query26	0.14	0.13	0.14
query27	0.06	0.06	0.05
query28	4.04	1.14	0.93
query29	12.60	3.97	3.26
query30	0.30	0.14	0.11
query31	2.81	0.59	0.38
query32	3.23	0.55	0.46
query33	3.05	3.01	3.07
query34	15.99	5.18	4.52
query35	4.50	4.57	4.54
query36	0.68	0.50	0.48
query37	0.10	0.06	0.07
query38	0.07	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.15	0.14
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.04	0.04
Total cold run time: 98.54 s
Total hot run time: 27.27 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 0.00% (0/5) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 80.00% (4/5) 🎉
Increment coverage report
Complete coverage report

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

PR approved by anyone and no changes requested.

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

github-actions bot commented Nov 7, 2025

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

@morningman morningman merged commit dfbaed9 into apache:master Nov 7, 2025
28 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 7, 2025
When using `query()` to query two different catalogs in a single SQL
statement, due to the hard-coded tableid, the BE will assume that all
scanNodes are querying the same table. This will cause scanner reuse,
resulting in different catalogs using the same JDBC connection.
github-actions bot pushed a commit that referenced this pull request Nov 7, 2025
When using `query()` to query two different catalogs in a single SQL
statement, due to the hard-coded tableid, the BE will assume that all
scanNodes are querying the same table. This will cause scanner reuse,
resulting in different catalogs using the same JDBC connection.
CalvinKirs pushed a commit to CalvinKirs/incubator-doris that referenced this pull request Nov 7, 2025
When using `query()` to query two different catalogs in a single SQL
statement, due to the hard-coded tableid, the BE will assume that all
scanNodes are querying the same table. This will cause scanner reuse,
resulting in different catalogs using the same JDBC connection.
morningman pushed a commit that referenced this pull request Nov 7, 2025
…7745 (#57798)

Cherry-picked from #57745

Co-authored-by: zy-kkk <zhongyk10@gmail.com>
yiguolei pushed a commit that referenced this pull request Nov 8, 2025
…7745 (#57799)

Cherry-picked from #57745

Co-authored-by: zy-kkk <zhongyk10@gmail.com>
Hastyshell pushed a commit to Hastyshell/doris that referenced this pull request Nov 12, 2025
…or query tvf apache#57745 (apache#5618)

cherry-picks from apache#57745
Related to apache#5568

Co-authored-by: zy-kkk <zhongyk10@gmail.com>
wyxxxcat pushed a commit to wyxxxcat/doris that referenced this pull request Nov 18, 2025
When using `query()` to query two different catalogs in a single SQL
statement, due to the hard-coded tableid, the BE will assume that all
scanNodes are querying the same table. This will cause scanner reuse,
resulting in different catalogs using the same JDBC connection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/3.0.x dev/3.1.3-merged dev/4.0.2-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants