Skip to content

branch-3.1: [fix](query tvf): resolve column mismatch error in JDBC query function #54077#54247

Merged
morrySnow merged 1 commit intoapache:branch-3.1from
morningman:31_pr890365817177701ac3fb8308c46870b692b92956
Aug 4, 2025
Merged

branch-3.1: [fix](query tvf): resolve column mismatch error in JDBC query function #54077#54247
morrySnow merged 1 commit intoapache:branch-3.1from
morningman:31_pr890365817177701ac3fb8308c46870b692b92956

Conversation

@morningman
Copy link
Contributor

bp #54077

@morningman morningman requested a review from morrySnow as a code owner August 3, 2025 21:45
@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?

apache#54077)

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:
  This PR addresses two issues with the WITH clause in SQL queries:
1. Column Count Mismatch: Previously, if the outer query selected fewer
columns than the inner query, an error would occur. This PR allows the
outer query to select a subset of the columns from the inner query,
preventing such errors.
2. Column Order Mismatch: The order of columns in the outer query did
not align with the results from the inner query, leading to incorrect
data alignment. This PR ensures that the results are returned in the
order specified by the outer query.

Co-authored-by: weixingyu12 <weixingyu12@jd.com>
@morningman morningman force-pushed the 31_pr890365817177701ac3fb8308c46870b692b92956 branch from df30521 to 49ad734 Compare August 3, 2025 21:48
@morningman morningman changed the title [fix](query tvf): resolve column mismatch error in JDBC query function (#54077) branch-3.1: [fix](query tvf): resolve column mismatch error in JDBC query function (#54077) Aug 3, 2025
@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 81.10% (1210/1492)
Line Coverage 65.41% (21373/32676)
Region Coverage 66.80% (10727/16059)
Branch Coverage 56.53% (5653/10000)

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/9) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 45.43% (12639/27822)
Line Coverage 36.28% (112681/310627)
Region Coverage 35.32% (58237/164896)
Branch Coverage 32.50% (31664/97416)

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17743	5522	5451	5451
q2	2058	306	162	162
q3	10552	1234	752	752
q4	10224	873	452	452
q5	7955	2405	2135	2135
q6	182	165	133	133
q7	886	755	618	618
q8	9361	1458	1207	1207
q9	5304	4928	4923	4923
q10	6787	2256	1817	1817
q11	481	280	268	268
q12	332	355	207	207
q13	17799	3623	3049	3049
q14	225	222	215	215
q15	549	471	482	471
q16	423	424	367	367
q17	623	868	371	371
q18	7068	6506	6373	6373
q19	1919	982	564	564
q20	320	336	204	204
q21	2967	2171	2010	2010
q22	1077	1012	982	982
Total cold run time: 104835 ms
Total hot run time: 32731 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5605	5567	5552	5552
q2	240	336	242	242
q3	2253	2627	2329	2329
q4	1350	1768	1309	1309
q5	4400	4924	4994	4924
q6	170	164	129	129
q7	2057	1974	1846	1846
q8	2658	2786	2727	2727
q9	7273	7187	7241	7187
q10	3070	3349	2721	2721
q11	566	509	479	479
q12	673	757	602	602
q13	3413	3819	3193	3193
q14	280	308	273	273
q15	522	477	488	477
q16	450	492	430	430
q17	1236	1739	1287	1287
q18	7603	7470	7276	7276
q19	851	1183	1073	1073
q20	2008	2177	1881	1881
q21	5406	4948	4709	4709
q22	1071	1097	1005	1005
Total cold run time: 53155 ms
Total hot run time: 51651 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 198632 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 49ad7342a909c4b9256fa3e2de6f03fe087ffe25, data reload: false

query1	1288	993	894	894
query2	6254	2017	1918	1918
query3	10909	4598	4565	4565
query4	33031	23846	23942	23846
query5	4890	610	472	472
query6	301	216	208	208
query7	4007	497	327	327
query8	306	254	243	243
query9	9555	2599	2599	2599
query10	485	329	262	262
query11	18530	15365	15184	15184
query12	155	112	104	104
query13	1550	531	434	434
query14	9228	7352	7674	7352
query15	230	206	186	186
query16	7827	693	497	497
query17	1584	801	601	601
query18	2092	419	321	321
query19	239	207	173	173
query20	130	121	117	117
query21	205	134	114	114
query22	4615	4615	4531	4531
query23	34834	34062	34184	34062
query24	7438	2695	2698	2695
query25	522	501	439	439
query26	734	292	175	175
query27	2046	484	362	362
query28	5208	2267	2214	2214
query29	622	596	462	462
query30	238	193	167	167
query31	1018	945	861	861
query32	71	64	54	54
query33	497	376	319	319
query34	745	869	519	519
query35	794	843	742	742
query36	1014	1064	966	966
query37	110	97	65	65
query38	3990	4048	3977	3977
query39	1486	1514	1493	1493
query40	197	112	104	104
query41	50	49	53	49
query42	121	102	103	102
query43	509	519	487	487
query44	1352	817	828	817
query45	182	178	169	169
query46	884	1050	687	687
query47	2023	2054	1987	1987
query48	419	448	369	369
query49	728	490	391	391
query50	703	707	425	425
query51	7414	7348	7293	7293
query52	102	102	95	95
query53	239	252	188	188
query54	556	564	473	473
query55	80	80	80	80
query56	266	273	270	270
query57	1295	1305	1214	1214
query58	253	222	244	222
query59	3187	3184	3037	3037
query60	295	285	274	274
query61	119	114	116	114
query62	817	759	707	707
query63	232	195	211	195
query64	2859	1014	676	676
query65	3498	3269	3355	3269
query66	795	420	321	321
query67	16325	15973	15704	15704
query68	7074	832	538	538
query69	506	307	268	268
query70	1189	1104	1092	1092
query71	430	292	268	268
query72	5839	3729	3953	3729
query73	652	762	353	353
query74	10588	9416	9230	9230
query75	3205	3140	2662	2662
query76	3011	1138	797	797
query77	476	361	276	276
query78	10347	10491	9606	9606
query79	3708	897	595	595
query80	741	517	433	433
query81	502	256	218	218
query82	657	118	89	89
query83	161	165	144	144
query84	244	104	82	82
query85	783	358	302	302
query86	377	323	310	310
query87	4302	4360	4287	4287
query88	4907	2384	2386	2384
query89	413	337	291	291
query90	1821	189	185	185
query91	138	139	111	111
query92	70	57	52	52
query93	2674	891	552	552
query94	706	417	301	301
query95	343	279	269	269
query96	498	611	283	283
query97	3187	3336	3190	3190
query98	223	215	201	201
query99	1334	1413	1295	1295
Total cold run time: 295384 ms
Total hot run time: 198632 ms

@doris-robot
Copy link

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

query1	0.03	0.04	0.03
query2	0.08	0.04	0.04
query3	0.24	0.05	0.05
query4	1.64	0.10	0.08
query5	0.52	0.50	0.50
query6	1.14	0.75	0.75
query7	0.02	0.02	0.02
query8	0.05	0.04	0.04
query9	0.58	0.53	0.49
query10	0.57	0.55	0.56
query11	0.15	0.14	0.12
query12	0.16	0.12	0.12
query13	0.61	0.60	0.60
query14	0.80	0.79	0.79
query15	0.86	0.83	0.82
query16	0.38	0.38	0.40
query17	1.04	1.07	1.07
query18	0.19	0.18	0.19
query19	2.00	1.92	1.94
query20	0.02	0.01	0.01
query21	15.36	0.95	0.66
query22	0.76	0.76	0.70
query23	14.84	1.44	0.68
query24	2.21	0.36	0.23
query25	0.15	0.09	0.08
query26	0.29	0.18	0.18
query27	0.09	0.08	0.08
query28	13.43	1.21	0.57
query29	12.62	4.00	3.35
query30	0.25	0.09	0.07
query31	2.83	0.61	0.40
query32	3.23	0.58	0.48
query33	3.01	3.06	3.06
query34	16.65	5.15	4.55
query35	4.67	4.60	4.57
query36	0.61	0.49	0.49
query37	0.20	0.17	0.17
query38	0.16	0.16	0.16
query39	0.06	0.04	0.04
query40	0.18	0.13	0.14
query41	0.11	0.06	0.06
query42	0.07	0.06	0.05
query43	0.05	0.04	0.04
Total cold run time: 102.91 s
Total hot run time: 29.36 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

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

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 66.67% (6/9) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.28% (20969/27489)
Line Coverage 69.71% (216383/310419)
Region Coverage 67.76% (129579/191233)
Branch Coverage 61.32% (67410/109940)

@morrySnow morrySnow changed the title branch-3.1: [fix](query tvf): resolve column mismatch error in JDBC query function (#54077) branch-3.1: [fix](query tvf): resolve column mismatch error in JDBC query function #54077 Aug 4, 2025
@morrySnow morrySnow merged commit 5d4bb91 into apache:branch-3.1 Aug 4, 2025
22 of 24 checks passed
@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 66.67% (6/9) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.20% (20946/27489)
Line Coverage 69.61% (216070/310419)
Region Coverage 67.64% (129348/191233)
Branch Coverage 61.17% (67245/109940)

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.

5 participants

Comments