You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "hubgeter (via GitHub)" <gi...@apache.org> on 2026/03/31 08:35:34 UTC

[PR] [fix](jdbc) Preserve query tvf column aliases across JDBC catalogs [doris]

hubgeter opened a new pull request, #61939:
URL: https://github.com/apache/doris/pull/61939

   ### What problem does this PR solve?
   
   Related PR: #34516
   
   Problem Summary:
   
   Fix bug:
   `query()` passes the SQL through to the JDBC catalog directly, so the returned column names should follow the aliases defined in that SQL.
   
   For example, for:
   ```sql
   select * from query(
     'catalog' = 'jdbc_catalog',
     'query' = 'select a as x from test.t'
   );
   ```
   the output column name should be `x`, not the original source column name `a`.
   
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [x] Regression test
       - [x] 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.
       - [x] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/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 -->
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc) Preserve query tvf column aliases across JDBC catalogs [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #61939:
URL: https://github.com/apache/doris/pull/61939#issuecomment-4161327049

   # FE UT Coverage Report
   Increment line coverage `  75.00% (3/4)` :tada:
   [Increment coverage report](http://coverage.selectdb-in.cc/coverage/61939_d708bec9c816c0571a891fcfcbdf97114af7284b/fe_increment_report/index.html)
   [Complete coverage report](http://coverage.selectdb-in.cc/coverage/61939_d708bec9c816c0571a891fcfcbdf97114af7284b/fe_report/index.html)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc) Preserve query tvf column aliases across JDBC catalogs [doris]

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman closed pull request #61939: [fix](jdbc) Preserve query tvf column aliases across JDBC catalogs
URL: https://github.com/apache/doris/pull/61939


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc) Preserve query tvf column aliases across JDBC catalogs [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #61939:
URL: https://github.com/apache/doris/pull/61939#issuecomment-4174845999

   PR approved by anyone and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc) Preserve query tvf column aliases across JDBC catalogs [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #61939:
URL: https://github.com/apache/doris/pull/61939#issuecomment-4160884879

   
   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/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?
       


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc) Preserve query tvf column aliases across JDBC catalogs [doris]

Posted by "hubgeter (via GitHub)" <gi...@apache.org>.
hubgeter commented on PR #61939:
URL: https://github.com/apache/doris/pull/61939#issuecomment-4160885509

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc) Preserve query tvf column aliases across JDBC catalogs [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #61939:
URL: https://github.com/apache/doris/pull/61939#issuecomment-4161016513

   
   <details>
   <summary>TPC-H: <b>Total hot run time: 26647 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
   Tpch sf100 test result on commit d708bec9c816c0571a891fcfcbdf97114af7284b, data reload: false
   
   ------ Round 1 ----------------------------------
   orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
   ============================================
   q1	17602	4470	4305	4305
   q2	q3	10658	796	526	526
   q4	4687	352	259	259
   q5	7558	1224	1012	1012
   q6	178	176	146	146
   q7	796	866	673	673
   q8	9314	1490	1359	1359
   q9	4916	4741	4747	4741
   q10	6246	1990	1642	1642
   q11	461	260	244	244
   q12	723	573	461	461
   q13	18031	2691	1941	1941
   q14	227	236	216	216
   q15	q16	722	735	668	668
   q17	722	826	446	446
   q18	5931	5347	5319	5319
   q19	1098	970	606	606
   q20	535	504	379	379
   q21	4458	1830	1412	1412
   q22	351	292	382	292
   Total cold run time: 95214 ms
   Total hot run time: 26647 ms
   
   ----- Round 2, with runtime_filter_mode=off -----
   orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
   ============================================
   q1	4874	4624	4601	4601
   q2	q3	3872	4361	3843	3843
   q4	897	1204	778	778
   q5	4148	4380	4336	4336
   q6	186	185	152	152
   q7	1742	1676	1547	1547
   q8	2527	2701	2508	2508
   q9	7819	7378	7485	7378
   q10	3735	3964	3637	3637
   q11	513	426	411	411
   q12	495	599	461	461
   q13	2484	2922	2128	2128
   q14	284	334	284	284
   q15	q16	729	762	711	711
   q17	1165	1319	1376	1319
   q18	7201	7034	6667	6667
   q19	914	985	952	952
   q20	2046	2141	2004	2004
   q21	3948	3632	3310	3310
   q22	452	425	412	412
   Total cold run time: 50031 ms
   Total hot run time: 47439 ms
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc) Preserve query tvf column aliases across JDBC catalogs [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #61939:
URL: https://github.com/apache/doris/pull/61939#issuecomment-4161081285

   
   <details>
   <summary>TPC-DS: <b>Total hot run time: 168433 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
   TPC-DS sf100 test result on commit d708bec9c816c0571a891fcfcbdf97114af7284b, data reload: false
   
   query5	4326	639	527	527
   query6	346	222	213	213
   query7	4218	463	251	251
   query8	355	244	226	226
   query9	8689	2725	2698	2698
   query10	504	391	334	334
   query11	6954	5062	4878	4878
   query12	189	136	132	132
   query13	1281	453	356	356
   query14	5825	3699	3412	3412
   query14_1	2841	2861	2855	2855
   query15	206	195	174	174
   query16	1019	476	460	460
   query17	1126	744	644	644
   query18	2499	466	357	357
   query19	224	219	182	182
   query20	140	126	128	126
   query21	216	137	113	113
   query22	13307	13914	14621	13914
   query23	16810	16386	15910	15910
   query23_1	15925	15744	15604	15604
   query24	7176	1617	1211	1211
   query24_1	1216	1227	1227	1227
   query25	561	453	401	401
   query26	1231	266	150	150
   query27	2772	475	290	290
   query28	4472	1814	1838	1814
   query29	856	562	485	485
   query30	304	227	189	189
   query31	1001	962	883	883
   query32	81	72	75	72
   query33	517	335	299	299
   query34	885	865	548	548
   query35	652	677	611	611
   query36	1109	1123	937	937
   query37	137	97	83	83
   query38	2976	2896	2841	2841
   query39	861	837	803	803
   query39_1	789	787	788	787
   query40	234	148	136	136
   query41	61	63	60	60
   query42	267	257	253	253
   query43	240	245	220	220
   query44	
   query45	202	190	183	183
   query46	858	984	603	603
   query47	2111	2134	2067	2067
   query48	303	308	223	223
   query49	632	469	375	375
   query50	680	279	229	229
   query51	4071	3999	4040	3999
   query52	260	265	253	253
   query53	295	334	286	286
   query54	314	268	268	268
   query55	94	96	84	84
   query56	310	331	324	324
   query57	1928	1547	1677	1547
   query58	281	271	272	271
   query59	2787	2973	2737	2737
   query60	342	324	332	324
   query61	168	156	159	156
   query62	641	594	555	555
   query63	303	277	272	272
   query64	5162	1294	1027	1027
   query65	
   query66	1453	461	358	358
   query67	24202	24189	24148	24148
   query68	
   query69	414	320	295	295
   query70	972	933	952	933
   query71	337	312	294	294
   query72	2848	2715	2426	2426
   query73	544	537	311	311
   query74	9620	9555	9398	9398
   query75	2854	2735	2470	2470
   query76	2312	1044	694	694
   query77	371	388	335	335
   query78	10918	11113	10495	10495
   query79	1141	766	567	567
   query80	709	656	584	584
   query81	486	267	228	228
   query82	1354	167	132	132
   query83	377	271	257	257
   query84	261	131	110	110
   query85	948	568	533	533
   query86	365	316	293	293
   query87	3174	3093	3028	3028
   query88	3543	2676	2693	2676
   query89	426	364	344	344
   query90	1976	180	178	178
   query91	171	164	138	138
   query92	75	72	77	72
   query93	915	832	504	504
   query94	450	312	294	294
   query95	590	406	325	325
   query96	645	510	226	226
   query97	2472	2482	2384	2384
   query98	232	226	216	216
   query99	1018	997	910	910
   Total cold run time: 249484 ms
   Total hot run time: 168433 ms
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc) Preserve query tvf column aliases across JDBC catalogs [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #61939:
URL: https://github.com/apache/doris/pull/61939#issuecomment-4174845870

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc) Preserve query tvf column aliases across JDBC catalogs [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #61939:
URL: https://github.com/apache/doris/pull/61939#issuecomment-4165852249

   No issues found in this review.
   
   Critical checkpoints:
   - Goal/test fit: The PR goal is to preserve JDBC `query()` TVF column aliases, and the code change accomplishes that on the `ResultSetMetaData` path used by `getColumnsFromQuery()`. Coverage includes a focused FE unit test and a regression test for both `desc function query(...)` and querying aliased columns.
   - Change scope: The modification is small and focused to `JdbcFieldSchema(ResultSetMetaData, int)`, which is the constructor used only for query-derived schemas, so regular JDBC table schema discovery remains unchanged.
   - Concurrency/lifecycle: No new concurrency, locking, lifecycle, config, compatibility, persistence, or FE/BE protocol concerns were introduced in this diff.
   - Parallel paths: I checked the adjacent JDBC schema-discovery path in `JdbcClient`; only the query-metadata path is changed, which matches the stated bug.
   - Conditional logic: The added fallback from `getColumnLabel()` to `getColumnName()` is straightforward and appropriate for drivers that return an empty label.
   - Test coverage/observability: Tests are present for the user-visible behavior. No additional observability looks necessary for this small metadata fix.
   - Performance: No meaningful performance impact; the change just swaps one metadata accessor for another with a safe fallback.
   - Other issues: None found from the reviewed code paths.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc) Preserve query tvf column aliases across JDBC catalogs [doris]

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman commented on PR #61939:
URL: https://github.com/apache/doris/pull/61939#issuecomment-4165839261

   /review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](jdbc) Preserve query tvf column aliases across JDBC catalogs [doris]

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman merged PR #61939:
URL: https://github.com/apache/doris/pull/61939


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org