Skip to content

Conversation

@ghkang98
Copy link
Contributor

@ghkang98 ghkang98 commented Jul 1, 2025

What problem does this PR solve?

Background

This PR mainly addresses the issue of case sensitivity for databases and tables in ExternalCatalog. By default, the database and table names in Doris are case-sensitive. However, if the user sets the lower_case_table_name parameter, the case sensitivity of table names changes. For example, when lower_case_table_name is set to 1, all table names are stored in lowercase.

This presents a problem: when accessing external data sources through a client, if the target data source is case-sensitive, using lowercase names may result in failure to retrieve information.

Example:

Assume there is a table named TABLE in the external system, and lower_case_table_name is set to 1, so the table name stored in Doris is table. When using table to access the external system, it may result in a "table not found" situation.

Therefore, we need to modify the current code and establish a principle:

  1. When accessing external systems, always use the original name.
  2. When accessing databases and tables synchronized from Doris itself, use the name recognized by Doris (e.g., lowercase, or any name if case-insensitive).

Currently, Doris records the synchronized name (name) and the original name (RemoteName) in ExternalDatabase and ExternalTable. We need to utilize this information to sort out all internal and external access interfaces to ensure correct behavior.

Main Modifications

  1. Added the NameMapping class and replaced the original SimpleTableInfo class.

    NameMapping records the CatalogId corresponding to a table, the local and original names of the corresponding DB, and the local and original names of the table itself.

  2. Modified all ExternalCache CacheKeys.

    For most ExternalCache, NameMapping is passed into the CacheKey. Since the cache typically interacts with external systems to retrieve information, the original name is needed. Meanwhile, some caches need to interact with Doris's internal metadata, so local storage name information is also required. Through NameMapping, we can clearly obtain this information to make correct calls.

  3. Restructured various interface parameters in the CatalogIf class, masking implementation differences between new and old optimizers and reducing redundant code.

  4. Fixed some metadata synchronization logic.

    For example, after a truncate table operation, other FEs need to execute afterTruncateTable for information synchronization. At this point, we only need to check if the current FE has cached information for the corresponding table; if so, clear the relevant cache. If not, there is no need to access the external system to retrieve this table, as accessing the external system might fail, interrupting metadata replay.

Release note

None

Check List (For Author)

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

@ghkang98
Copy link
Contributor Author

ghkang98 commented Jul 1, 2025

run buildall

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 5.66% (3/53) 🎉
Increment coverage report
Complete coverage report

@ghkang98
Copy link
Contributor Author

ghkang98 commented Jul 1, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17603	5230	5088	5088
q2	1931	291	179	179
q3	10345	1355	734	734
q4	10217	1044	518	518
q5	7681	2433	2363	2363
q6	184	161	131	131
q7	887	748	605	605
q8	9325	1291	1138	1138
q9	6763	5081	5122	5081
q10	6905	2384	1965	1965
q11	499	291	263	263
q12	336	360	212	212
q13	17795	3673	3123	3123
q14	230	234	216	216
q15	537	474	475	474
q16	430	437	397	397
q17	588	864	351	351
q18	8028	7381	7173	7173
q19	1208	957	553	553
q20	328	347	218	218
q21	3914	3209	2369	2369
q22	1068	1005	935	935
Total cold run time: 106802 ms
Total hot run time: 34086 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5178	5121	5172	5121
q2	244	325	224	224
q3	2190	2670	2237	2237
q4	1375	1763	1379	1379
q5	4207	4183	4119	4119
q6	199	162	122	122
q7	1868	1807	1687	1687
q8	2528	2539	2452	2452
q9	6821	6774	6833	6774
q10	2990	3141	2684	2684
q11	557	504	489	489
q12	657	741	585	585
q13	3374	3762	3119	3119
q14	265	292	264	264
q15	506	464	460	460
q16	412	473	425	425
q17	1121	1483	1321	1321
q18	7450	7153	7149	7149
q19	789	780	916	780
q20	1892	1978	1845	1845
q21	4782	4280	4367	4280
q22	1042	1029	975	975
Total cold run time: 50447 ms
Total hot run time: 48491 ms

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 5.66% (3/53) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

TPC-DS: Total hot run time: 185456 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 724ccb92116998a2232e42fb456f896f05785c4d, data reload: false

query1	999	390	395	390
query2	6512	1762	1746	1746
query3	6741	208	206	206
query4	26402	23887	23283	23283
query5	4854	581	430	430
query6	292	206	194	194
query7	4628	483	275	275
query8	280	214	226	214
query9	8627	2613	2640	2613
query10	516	317	267	267
query11	15559	15009	14804	14804
query12	175	106	102	102
query13	1648	523	406	406
query14	9958	5681	5720	5681
query15	210	186	176	176
query16	7646	633	468	468
query17	1283	723	583	583
query18	2017	396	309	309
query19	196	187	163	163
query20	118	118	119	118
query21	212	125	106	106
query22	4260	4196	3994	3994
query23	34083	33190	33092	33092
query24	8339	2385	2419	2385
query25	535	454	393	393
query26	1247	265	148	148
query27	2729	511	349	349
query28	4265	2138	2118	2118
query29	715	556	477	477
query30	283	220	187	187
query31	931	850	765	765
query32	99	61	59	59
query33	551	362	304	304
query34	795	838	524	524
query35	812	833	717	717
query36	934	995	882	882
query37	108	97	73	73
query38	4143	4086	4081	4081
query39	1479	1401	1428	1401
query40	220	116	101	101
query41	54	55	50	50
query42	121	104	103	103
query43	506	511	469	469
query44	1313	823	819	819
query45	178	169	159	159
query46	842	1029	639	639
query47	1741	1790	1694	1694
query48	370	419	305	305
query49	743	473	398	398
query50	634	672	415	415
query51	4128	4139	4083	4083
query52	108	103	96	96
query53	222	251	187	187
query54	572	559	497	497
query55	87	76	80	76
query56	308	293	285	285
query57	1184	1199	1105	1105
query58	262	250	250	250
query59	2643	2732	2581	2581
query60	314	317	315	315
query61	120	123	120	120
query62	787	732	665	665
query63	212	187	194	187
query64	4264	1059	732	732
query65	4251	4161	4179	4161
query66	1063	408	337	337
query67	15760	15493	15479	15479
query68	8140	891	516	516
query69	467	299	260	260
query70	1230	1109	1025	1025
query71	486	331	308	308
query72	5516	4817	4843	4817
query73	722	637	352	352
query74	8845	9167	9117	9117
query75	3850	3198	2682	2682
query76	3748	1145	705	705
query77	817	385	306	306
query78	10106	10095	9328	9328
query79	3077	824	584	584
query80	624	496	458	458
query81	513	252	225	225
query82	498	121	92	92
query83	266	253	228	228
query84	295	103	83	83
query85	796	425	309	309
query86	382	288	291	288
query87	4503	4404	4371	4371
query88	3564	2283	2300	2283
query89	393	320	286	286
query90	1887	207	201	201
query91	134	136	108	108
query92	76	58	55	55
query93	2103	939	579	579
query94	661	400	308	308
query95	380	294	291	291
query96	487	567	286	286
query97	2745	2793	2680	2680
query98	228	208	212	208
query99	1466	1413	1326	1326
Total cold run time: 277193 ms
Total hot run time: 185456 ms

@ghkang98
Copy link
Contributor Author

ghkang98 commented Jul 1, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17683	5292	5106	5106
q2	1944	300	196	196
q3	10668	1321	709	709
q4	10297	1035	527	527
q5	8592	2414	2375	2375
q6	191	165	129	129
q7	907	754	604	604
q8	9328	1340	1149	1149
q9	6934	5184	5151	5151
q10	6935	2400	1967	1967
q11	473	292	273	273
q12	339	355	213	213
q13	17763	3695	3093	3093
q14	230	229	220	220
q15	532	483	475	475
q16	432	428	378	378
q17	614	874	357	357
q18	7673	7232	7156	7156
q19	1233	941	581	581
q20	337	364	230	230
q21	3824	3228	2439	2439
q22	1058	1024	962	962
Total cold run time: 107987 ms
Total hot run time: 34290 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5158	5135	5192	5135
q2	243	325	219	219
q3	2160	2680	2295	2295
q4	1412	1791	1369	1369
q5	4451	4518	4515	4515
q6	218	172	127	127
q7	2060	1919	1823	1823
q8	2639	2622	2609	2609
q9	7425	7470	7282	7282
q10	3076	3323	3004	3004
q11	566	526	474	474
q12	663	728	581	581
q13	3314	3710	3132	3132
q14	260	280	248	248
q15	507	468	465	465
q16	433	481	425	425
q17	1120	1503	1353	1353
q18	7437	7184	7187	7184
q19	831	818	970	818
q20	1968	2046	1851	1851
q21	4770	4330	4257	4257
q22	1075	1047	1005	1005
Total cold run time: 51786 ms
Total hot run time: 50171 ms

@doris-robot
Copy link

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

query1	1011	398	409	398
query2	6523	1726	1691	1691
query3	6742	211	211	211
query4	26408	23693	22982	22982
query5	4369	610	429	429
query6	296	219	198	198
query7	4622	500	291	291
query8	282	225	202	202
query9	8621	2624	2646	2624
query10	476	342	273	273
query11	15178	15048	14913	14913
query12	164	113	108	108
query13	1663	546	394	394
query14	8937	5745	5831	5745
query15	202	195	181	181
query16	7659	649	474	474
query17	1205	736	601	601
query18	2064	401	308	308
query19	196	198	177	177
query20	120	116	110	110
query21	210	136	108	108
query22	4136	4146	4150	4146
query23	34118	33249	33006	33006
query24	8604	2458	2370	2370
query25	523	456	394	394
query26	1230	267	153	153
query27	2740	514	346	346
query28	4311	2137	2109	2109
query29	718	556	444	444
query30	286	223	186	186
query31	896	846	749	749
query32	75	64	60	60
query33	558	372	320	320
query34	792	840	527	527
query35	796	795	738	738
query36	922	954	883	883
query37	111	103	79	79
query38	4162	4127	4153	4127
query39	1497	1409	1412	1409
query40	205	123	101	101
query41	57	74	55	55
query42	133	114	105	105
query43	491	496	463	463
query44	1353	825	818	818
query45	174	172	164	164
query46	840	1004	627	627
query47	1746	1761	1714	1714
query48	385	411	331	331
query49	745	490	380	380
query50	631	687	427	427
query51	4112	4167	4117	4117
query52	113	112	97	97
query53	228	252	195	195
query54	580	566	512	512
query55	80	80	81	80
query56	328	294	281	281
query57	1180	1198	1111	1111
query58	263	254	267	254
query59	2560	2582	2485	2485
query60	336	316	301	301
query61	135	120	119	119
query62	771	705	658	658
query63	224	183	190	183
query64	4287	1004	654	654
query65	4302	4190	4218	4190
query66	1086	409	328	328
query67	15741	15648	15297	15297
query68	8108	905	516	516
query69	465	304	267	267
query70	1175	1100	1121	1100
query71	482	333	295	295
query72	5820	4875	4888	4875
query73	752	660	350	350
query74	8843	8950	8845	8845
query75	3881	3167	2691	2691
query76	3705	1147	741	741
query77	783	391	292	292
query78	10031	10006	9370	9370
query79	2793	815	612	612
query80	732	518	456	456
query81	488	265	219	219
query82	484	131	100	100
query83	287	254	233	233
query84	306	107	88	88
query85	815	412	316	316
query86	382	305	280	280
query87	4426	4438	4337	4337
query88	3521	2275	2263	2263
query89	388	323	296	296
query90	1838	216	218	216
query91	152	145	110	110
query92	74	59	57	57
query93	1823	962	584	584
query94	676	404	311	311
query95	380	297	289	289
query96	499	574	278	278
query97	2736	2759	2704	2704
query98	236	208	204	204
query99	1428	1402	1288	1288
Total cold run time: 275018 ms
Total hot run time: 185094 ms

@doris-robot
Copy link

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

query1	0.04	0.04	0.04
query2	0.07	0.04	0.04
query3	0.25	0.07	0.06
query4	1.62	0.11	0.11
query5	0.41	0.43	0.43
query6	1.16	0.67	0.66
query7	0.02	0.02	0.01
query8	0.05	0.04	0.03
query9	0.60	0.53	0.52
query10	0.58	0.57	0.57
query11	0.16	0.11	0.10
query12	0.15	0.12	0.11
query13	0.63	0.61	0.61
query14	0.82	0.82	0.81
query15	0.90	0.89	0.86
query16	0.40	0.37	0.40
query17	1.05	1.07	1.07
query18	0.24	0.21	0.22
query19	1.96	1.86	1.81
query20	0.02	0.01	0.02
query21	15.40	0.87	0.53
query22	0.75	1.21	0.65
query23	15.01	1.39	0.63
query24	6.86	2.59	0.59
query25	0.45	0.14	0.13
query26	0.60	0.17	0.13
query27	0.07	0.06	0.06
query28	9.46	0.87	0.44
query29	12.53	4.06	3.31
query30	0.25	0.08	0.07
query31	2.84	0.59	0.38
query32	3.26	0.55	0.48
query33	3.04	3.08	3.22
query34	15.97	5.37	4.76
query35	4.84	4.82	4.84
query36	0.69	0.51	0.49
query37	0.09	0.07	0.07
query38	0.06	0.04	0.04
query39	0.04	0.02	0.03
query40	0.16	0.14	0.12
query41	0.08	0.02	0.02
query42	0.03	0.03	0.02
query43	0.04	0.04	0.04
Total cold run time: 103.65 s
Total hot run time: 29.31 s

@ghkang98
Copy link
Contributor Author

ghkang98 commented Jul 2, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17585	5075	5041	5041
q2	1945	317	198	198
q3	10246	1270	756	756
q4	10263	1037	554	554
q5	7854	2339	2355	2339
q6	187	162	133	133
q7	890	785	623	623
q8	9332	1312	1083	1083
q9	6754	5056	5078	5056
q10	6953	2397	1967	1967
q11	488	300	288	288
q12	355	355	224	224
q13	17774	3728	3114	3114
q14	233	241	215	215
q15	563	486	490	486
q16	437	438	403	403
q17	649	858	393	393
q18	7613	7090	6997	6997
q19	1567	966	581	581
q20	362	369	244	244
q21	4209	3331	3202	3202
q22	1070	1021	954	954
Total cold run time: 107329 ms
Total hot run time: 34851 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5136	5057	5012	5012
q2	252	314	217	217
q3	2236	2657	2332	2332
q4	1422	1786	1377	1377
q5	4351	4570	4509	4509
q6	223	166	150	150
q7	2061	1904	1897	1897
q8	2688	2729	2549	2549
q9	7414	7302	7242	7242
q10	3157	3363	2954	2954
q11	618	526	532	526
q12	765	816	706	706
q13	3694	4167	3533	3533
q14	292	330	288	288
q15	523	483	484	483
q16	452	510	451	451
q17	1224	1549	1386	1386
q18	7942	7623	7000	7000
q19	858	827	954	827
q20	1933	1979	1805	1805
q21	4857	4471	4413	4413
q22	1062	1033	976	976
Total cold run time: 53160 ms
Total hot run time: 50633 ms

@doris-robot
Copy link

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

query1	1017	420	402	402
query2	6529	1739	1763	1739
query3	6736	226	226	226
query4	26234	23982	23302	23302
query5	4493	620	506	506
query6	318	239	209	209
query7	4636	516	312	312
query8	303	231	225	225
query9	8635	2880	2886	2880
query10	485	338	279	279
query11	15665	14985	14784	14784
query12	168	111	101	101
query13	1647	557	452	452
query14	9214	5918	5787	5787
query15	214	201	184	184
query16	7220	629	459	459
query17	1180	752	626	626
query18	2011	430	332	332
query19	209	218	178	178
query20	130	119	118	118
query21	218	127	116	116
query22	4170	4310	4200	4200
query23	34638	33359	33106	33106
query24	8503	2453	2465	2453
query25	589	514	449	449
query26	1245	282	169	169
query27	2718	528	368	368
query28	4337	2326	2290	2290
query29	811	607	478	478
query30	300	227	207	207
query31	929	869	769	769
query32	75	71	68	68
query33	578	470	324	324
query34	851	870	565	565
query35	804	843	758	758
query36	1026	1020	957	957
query37	127	108	82	82
query38	4248	4280	4178	4178
query39	1534	1428	1441	1428
query40	217	124	114	114
query41	62	59	61	59
query42	132	117	110	110
query43	534	540	512	512
query44	1425	892	903	892
query45	183	174	167	167
query46	895	1047	669	669
query47	1774	1780	1723	1723
query48	405	444	335	335
query49	754	501	405	405
query50	690	704	450	450
query51	4139	4214	4174	4174
query52	125	114	103	103
query53	245	284	207	207
query54	622	612	544	544
query55	95	85	90	85
query56	319	318	295	295
query57	1218	1205	1139	1139
query58	281	277	277	277
query59	2719	2832	2716	2716
query60	366	356	336	336
query61	133	127	131	127
query62	822	711	656	656
query63	235	207	206	206
query64	4360	1034	743	743
query65	4340	4232	4245	4232
query66	1145	417	327	327
query67	15840	15844	15670	15670
query68	9473	969	599	599
query69	493	331	283	283
query70	1297	1227	1208	1208
query71	474	360	335	335
query72	5280	4794	4756	4756
query73	723	634	384	384
query74	9237	9313	9112	9112
query75	4286	3168	2889	2889
query76	4080	1182	783	783
query77	986	403	312	312
query78	10002	10216	9553	9553
query79	2171	877	617	617
query80	644	535	470	470
query81	467	252	230	230
query82	238	131	102	102
query83	301	308	252	252
query84	298	110	91	91
query85	769	381	339	339
query86	341	321	301	301
query87	4545	4587	4432	4432
query88	3143	2470	2488	2470
query89	415	332	297	297
query90	2094	220	207	207
query91	142	140	121	121
query92	80	60	65	60
query93	1907	1003	647	647
query94	667	382	311	311
query95	394	308	302	302
query96	540	589	300	300
query97	2729	2766	2670	2670
query98	249	221	216	216
query99	1448	1412	1271	1271
Total cold run time: 278733 ms
Total hot run time: 189259 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.04
query2	0.08	0.05	0.04
query3	0.25	0.08	0.08
query4	1.61	0.11	0.12
query5	0.44	0.44	0.43
query6	1.18	0.67	0.67
query7	0.03	0.02	0.02
query8	0.04	0.04	0.04
query9	0.60	0.54	0.53
query10	0.58	0.57	0.58
query11	0.16	0.11	0.11
query12	0.15	0.12	0.12
query13	0.64	0.61	0.62
query14	0.81	0.83	0.82
query15	0.94	0.89	0.88
query16	0.40	0.40	0.40
query17	1.10	1.07	1.11
query18	0.24	0.23	0.22
query19	1.99	1.87	1.96
query20	0.02	0.02	0.02
query21	15.36	0.89	0.58
query22	0.78	1.08	0.66
query23	14.95	1.43	0.62
query24	7.39	1.09	0.49
query25	0.50	0.20	0.09
query26	0.58	0.17	0.16
query27	0.07	0.05	0.06
query28	9.31	1.00	0.46
query29	12.53	4.27	3.44
query30	0.26	0.10	0.08
query31	2.82	0.62	0.41
query32	3.24	0.58	0.47
query33	3.10	3.12	3.22
query34	16.06	5.43	4.75
query35	4.85	4.87	4.82
query36	0.69	0.52	0.49
query37	0.10	0.06	0.06
query38	0.06	0.04	0.04
query39	0.03	0.02	0.02
query40	0.17	0.15	0.14
query41	0.09	0.03	0.02
query42	0.04	0.03	0.02
query43	0.05	0.03	0.03
Total cold run time: 104.34 s
Total hot run time: 29.67 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 5.66% (3/53) 🎉
Increment coverage report
Complete coverage report

@morningman morningman marked this pull request as draft July 2, 2025 07:13
@morningman
Copy link
Contributor

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17594	5174	4991	4991
q2	1929	274	186	186
q3	10396	1279	684	684
q4	10264	998	503	503
q5	8408	2570	2374	2374
q6	186	161	126	126
q7	890	742	594	594
q8	9316	1286	1049	1049
q9	6799	5082	5125	5082
q10	6858	2354	1959	1959
q11	469	284	273	273
q12	338	345	210	210
q13	17753	3656	3118	3118
q14	230	218	209	209
q15	557	477	486	477
q16	423	418	379	379
q17	577	841	340	340
q18	7546	7230	7075	7075
q19	1596	940	539	539
q20	306	344	207	207
q21	3590	3124	2294	2294
q22	1052	1011	979	979
Total cold run time: 107077 ms
Total hot run time: 33648 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5098	5075	5032	5032
q2	243	326	223	223
q3	2148	2646	2300	2300
q4	1365	1772	1341	1341
q5	4178	4513	4579	4513
q6	208	169	125	125
q7	2006	1937	1798	1798
q8	2622	2605	2563	2563
q9	7384	7280	7418	7280
q10	3151	3224	2829	2829
q11	562	516	489	489
q12	677	765	653	653
q13	3493	4119	3287	3287
q14	277	309	275	275
q15	519	470	480	470
q16	455	484	434	434
q17	1190	1604	1377	1377
q18	8052	7725	7635	7635
q19	767	801	818	801
q20	1908	1978	1811	1811
q21	4714	4332	4297	4297
q22	1035	1024	1012	1012
Total cold run time: 52052 ms
Total hot run time: 50545 ms

@doris-robot
Copy link

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

query1	1019	393	379	379
query2	6547	1722	1644	1644
query3	6734	207	207	207
query4	26451	23909	23161	23161
query5	4380	583	422	422
query6	308	214	190	190
query7	4623	471	287	287
query8	294	233	215	215
query9	8600	2606	2613	2606
query10	441	337	265	265
query11	15771	15025	14748	14748
query12	144	109	103	103
query13	1664	503	401	401
query14	9082	5500	5428	5428
query15	193	187	169	169
query16	7310	595	465	465
query17	1165	710	561	561
query18	1966	397	285	285
query19	186	182	152	152
query20	125	117	114	114
query21	213	119	105	105
query22	4195	4167	4171	4167
query23	33791	33036	33186	33036
query24	8416	2358	2379	2358
query25	540	453	383	383
query26	1227	267	151	151
query27	2775	504	344	344
query28	4350	2100	2116	2100
query29	745	558	426	426
query30	282	209	184	184
query31	920	845	775	775
query32	73	64	61	61
query33	537	384	321	321
query34	787	824	514	514
query35	793	848	739	739
query36	928	967	870	870
query37	117	100	74	74
query38	4061	4145	4055	4055
query39	1459	1423	1396	1396
query40	217	114	104	104
query41	56	55	50	50
query42	122	110	103	103
query43	494	499	470	470
query44	1281	813	811	811
query45	172	171	159	159
query46	824	1007	624	624
query47	1778	1781	1759	1759
query48	380	413	313	313
query49	780	503	393	393
query50	621	682	399	399
query51	4051	4170	4114	4114
query52	108	104	102	102
query53	222	256	177	177
query54	568	565	502	502
query55	82	77	81	77
query56	293	295	297	295
query57	1186	1184	1154	1154
query58	267	247	251	247
query59	2539	2647	2571	2571
query60	329	333	314	314
query61	117	147	114	114
query62	801	706	657	657
query63	223	179	183	179
query64	4310	993	634	634
query65	4283	4165	4193	4165
query66	1139	414	309	309
query67	15571	15395	15485	15395
query68	5740	890	523	523
query69	476	301	267	267
query70	1220	1112	1111	1111
query71	405	328	289	289
query72	5318	4935	4807	4807
query73	650	585	355	355
query74	9329	9431	8752	8752
query75	3181	3181	2689	2689
query76	3180	1143	704	704
query77	487	365	285	285
query78	9985	10085	9397	9397
query79	2983	783	578	578
query80	1612	593	454	454
query81	554	256	213	213
query82	419	130	94	94
query83	340	242	224	224
query84	248	109	86	86
query85	803	358	308	308
query86	466	285	270	270
query87	4370	4479	4267	4267
query88	3998	2244	2235	2235
query89	381	305	282	282
query90	1920	203	201	201
query91	133	137	107	107
query92	75	59	55	55
query93	2660	940	573	573
query94	734	409	299	299
query95	376	284	283	283
query96	486	561	277	277
query97	2690	2765	2675	2675
query98	233	201	204	201
query99	1320	1414	1256	1256
Total cold run time: 272798 ms
Total hot run time: 184169 ms

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 33.90% (261/770) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.08	0.04	0.04
query3	0.26	0.07	0.07
query4	1.63	0.12	0.11
query5	0.44	0.42	0.42
query6	1.20	0.66	0.66
query7	0.02	0.01	0.02
query8	0.05	0.03	0.04
query9	0.60	0.50	0.53
query10	0.56	0.57	0.56
query11	0.16	0.11	0.11
query12	0.15	0.12	0.12
query13	0.62	0.61	0.61
query14	0.79	0.81	0.82
query15	0.90	0.86	0.88
query16	0.38	0.40	0.39
query17	1.08	1.12	1.07
query18	0.22	0.21	0.21
query19	1.91	1.86	1.92
query20	0.01	0.01	0.01
query21	15.42	0.93	0.55
query22	0.75	1.26	0.74
query23	14.80	1.37	0.65
query24	7.43	1.06	1.16
query25	0.50	0.14	0.16
query26	0.60	0.17	0.13
query27	0.07	0.05	0.06
query28	9.14	0.86	0.46
query29	12.60	3.92	3.33
query30	0.25	0.09	0.06
query31	2.85	0.63	0.38
query32	3.24	0.56	0.47
query33	3.09	3.15	3.11
query34	16.08	5.35	4.77
query35	4.81	4.84	4.80
query36	0.70	0.50	0.50
query37	0.09	0.07	0.06
query38	0.05	0.04	0.03
query39	0.03	0.02	0.02
query40	0.17	0.14	0.13
query41	0.08	0.02	0.03
query42	0.03	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 103.91 s
Total hot run time: 29.99 s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

我看这个TablePartitionKey类用得地方也比较少,如果只用于本地名字的比较,用LocalTablePartitionKey是更精确一点吗?

Copy link
Contributor

Choose a reason for hiding this comment

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

I add comment in this class, so I think the name is ok

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

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

github-actions bot commented Jul 3, 2025

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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2025

PR approved by anyone and no changes requested.

@morningman morningman merged commit 5c53bfc into apache:master Jul 3, 2025
26 of 28 checks passed
koarz pushed a commit to koarz/doris that referenced this pull request Jul 4, 2025
…he#52561)

### What problem does this PR solve?

#### Background

This PR mainly addresses the issue of case sensitivity for databases and
tables in `ExternalCatalog`. By default, the database and table names in
Doris are case-sensitive. However, if the user sets the
`lower_case_table_name` parameter, the case sensitivity of table names
changes. For example, when `lower_case_table_name` is set to 1, all
table names are stored in lowercase.

This presents a problem: when accessing external data sources through a
client, if the target data source is case-sensitive, using lowercase
names may result in failure to retrieve information.

Example:

Assume there is a table named `TABLE` in the external system, and
`lower_case_table_name` is set to 1, so the table name stored in Doris
is `table`. When using `table` to access the external system, it may
result in a "table not found" situation.

Therefore, we need to modify the current code and establish a principle:

1. When accessing external systems, always use the original name.
2. When accessing databases and tables synchronized from Doris itself,
use the name recognized by Doris (e.g., lowercase, or any name if
case-insensitive).

Currently, Doris records the synchronized name (name) and the original
name (RemoteName) in `ExternalDatabase` and `ExternalTable`. We need to
utilize this information to sort out all internal and external access
interfaces to ensure correct behavior.

#### Main Modifications

1. Added the `NameMapping` class and replaced the original
`SimpleTableInfo` class.

`NameMapping` records the CatalogId corresponding to a table, the local
and original names of the corresponding DB, and the local and original
names of the table itself.

2. Modified all `ExternalCache` CacheKeys.

For most `ExternalCache`, `NameMapping` is passed into the CacheKey.
Since the cache typically interacts with external systems to retrieve
information, the original name is needed. Meanwhile, some caches need to
interact with Doris's internal metadata, so local storage name
information is also required. Through `NameMapping`, we can clearly
obtain this information to make correct calls.

3. Restructured various interface parameters in the `CatalogIf` class,
masking implementation differences between new and old optimizers and
reducing redundant code.

4. Fixed some metadata synchronization logic.

For example, after a truncate table operation, other FEs need to execute
`afterTruncateTable` for information synchronization. At this point, we
only need to check if the current FE has cached information for the
corresponding table; if so, clear the relevant cache. If not, there is
no need to access the external system to retrieve this table, as
accessing the external system might fail, interrupting metadata replay.
koarz pushed a commit to koarz/doris that referenced this pull request Jul 4, 2025
…he#52561)

### What problem does this PR solve?

#### Background

This PR mainly addresses the issue of case sensitivity for databases and
tables in `ExternalCatalog`. By default, the database and table names in
Doris are case-sensitive. However, if the user sets the
`lower_case_table_name` parameter, the case sensitivity of table names
changes. For example, when `lower_case_table_name` is set to 1, all
table names are stored in lowercase.

This presents a problem: when accessing external data sources through a
client, if the target data source is case-sensitive, using lowercase
names may result in failure to retrieve information.

Example:

Assume there is a table named `TABLE` in the external system, and
`lower_case_table_name` is set to 1, so the table name stored in Doris
is `table`. When using `table` to access the external system, it may
result in a "table not found" situation.

Therefore, we need to modify the current code and establish a principle:

1. When accessing external systems, always use the original name.
2. When accessing databases and tables synchronized from Doris itself,
use the name recognized by Doris (e.g., lowercase, or any name if
case-insensitive).

Currently, Doris records the synchronized name (name) and the original
name (RemoteName) in `ExternalDatabase` and `ExternalTable`. We need to
utilize this information to sort out all internal and external access
interfaces to ensure correct behavior.

#### Main Modifications

1. Added the `NameMapping` class and replaced the original
`SimpleTableInfo` class.

`NameMapping` records the CatalogId corresponding to a table, the local
and original names of the corresponding DB, and the local and original
names of the table itself.

2. Modified all `ExternalCache` CacheKeys.

For most `ExternalCache`, `NameMapping` is passed into the CacheKey.
Since the cache typically interacts with external systems to retrieve
information, the original name is needed. Meanwhile, some caches need to
interact with Doris's internal metadata, so local storage name
information is also required. Through `NameMapping`, we can clearly
obtain this information to make correct calls.

3. Restructured various interface parameters in the `CatalogIf` class,
masking implementation differences between new and old optimizers and
reducing redundant code.

4. Fixed some metadata synchronization logic.

For example, after a truncate table operation, other FEs need to execute
`afterTruncateTable` for information synchronization. At this point, we
only need to check if the current FE has cached information for the
corresponding table; if so, clear the relevant cache. If not, there is
no need to access the external system to retrieve this table, as
accessing the external system might fail, interrupting metadata replay.
koarz pushed a commit to koarz/doris that referenced this pull request Jul 4, 2025
…he#52561)

### What problem does this PR solve?

#### Background

This PR mainly addresses the issue of case sensitivity for databases and
tables in `ExternalCatalog`. By default, the database and table names in
Doris are case-sensitive. However, if the user sets the
`lower_case_table_name` parameter, the case sensitivity of table names
changes. For example, when `lower_case_table_name` is set to 1, all
table names are stored in lowercase.

This presents a problem: when accessing external data sources through a
client, if the target data source is case-sensitive, using lowercase
names may result in failure to retrieve information.

Example:

Assume there is a table named `TABLE` in the external system, and
`lower_case_table_name` is set to 1, so the table name stored in Doris
is `table`. When using `table` to access the external system, it may
result in a "table not found" situation.

Therefore, we need to modify the current code and establish a principle:

1. When accessing external systems, always use the original name.
2. When accessing databases and tables synchronized from Doris itself,
use the name recognized by Doris (e.g., lowercase, or any name if
case-insensitive).

Currently, Doris records the synchronized name (name) and the original
name (RemoteName) in `ExternalDatabase` and `ExternalTable`. We need to
utilize this information to sort out all internal and external access
interfaces to ensure correct behavior.

#### Main Modifications

1. Added the `NameMapping` class and replaced the original
`SimpleTableInfo` class.

`NameMapping` records the CatalogId corresponding to a table, the local
and original names of the corresponding DB, and the local and original
names of the table itself.

2. Modified all `ExternalCache` CacheKeys.

For most `ExternalCache`, `NameMapping` is passed into the CacheKey.
Since the cache typically interacts with external systems to retrieve
information, the original name is needed. Meanwhile, some caches need to
interact with Doris's internal metadata, so local storage name
information is also required. Through `NameMapping`, we can clearly
obtain this information to make correct calls.

3. Restructured various interface parameters in the `CatalogIf` class,
masking implementation differences between new and old optimizers and
reducing redundant code.

4. Fixed some metadata synchronization logic.

For example, after a truncate table operation, other FEs need to execute
`afterTruncateTable` for information synchronization. At this point, we
only need to check if the current FE has cached information for the
corresponding table; if so, clear the relevant cache. If not, there is
no need to access the external system to retrieve this table, as
accessing the external system might fail, interrupting metadata replay.
@morningman morningman mentioned this pull request Jul 4, 2025
7 tasks
seawinde pushed a commit to seawinde/doris that referenced this pull request Jul 4, 2025
…he#52561)

### What problem does this PR solve?

#### Background

This PR mainly addresses the issue of case sensitivity for databases and
tables in `ExternalCatalog`. By default, the database and table names in
Doris are case-sensitive. However, if the user sets the
`lower_case_table_name` parameter, the case sensitivity of table names
changes. For example, when `lower_case_table_name` is set to 1, all
table names are stored in lowercase.

This presents a problem: when accessing external data sources through a
client, if the target data source is case-sensitive, using lowercase
names may result in failure to retrieve information.

Example:

Assume there is a table named `TABLE` in the external system, and
`lower_case_table_name` is set to 1, so the table name stored in Doris
is `table`. When using `table` to access the external system, it may
result in a "table not found" situation.

Therefore, we need to modify the current code and establish a principle:

1. When accessing external systems, always use the original name.
2. When accessing databases and tables synchronized from Doris itself,
use the name recognized by Doris (e.g., lowercase, or any name if
case-insensitive).

Currently, Doris records the synchronized name (name) and the original
name (RemoteName) in `ExternalDatabase` and `ExternalTable`. We need to
utilize this information to sort out all internal and external access
interfaces to ensure correct behavior.

#### Main Modifications

1. Added the `NameMapping` class and replaced the original
`SimpleTableInfo` class.

`NameMapping` records the CatalogId corresponding to a table, the local
and original names of the corresponding DB, and the local and original
names of the table itself.

2. Modified all `ExternalCache` CacheKeys.

For most `ExternalCache`, `NameMapping` is passed into the CacheKey.
Since the cache typically interacts with external systems to retrieve
information, the original name is needed. Meanwhile, some caches need to
interact with Doris's internal metadata, so local storage name
information is also required. Through `NameMapping`, we can clearly
obtain this information to make correct calls.

3. Restructured various interface parameters in the `CatalogIf` class,
masking implementation differences between new and old optimizers and
reducing redundant code.

4. Fixed some metadata synchronization logic.

For example, after a truncate table operation, other FEs need to execute
`afterTruncateTable` for information synchronization. At this point, we
only need to check if the current FE has cached information for the
corresponding table; if so, clear the relevant cache. If not, there is
no need to access the external system to retrieve this table, as
accessing the external system might fail, interrupting metadata replay.
morningman added a commit that referenced this pull request Jul 6, 2025
#52817)

Followup #52561
Also fix a bug introduced by #51471, which lost the function rules in
jdbc external table.
morningman pushed a commit that referenced this pull request Jul 8, 2025
### What problem does this PR solve?
relate pr: #52561
Fix CacheException msg in loadSnapshot to make
test_paimon_catalog.groovy happy
morningman pushed a commit to morningman/doris that referenced this pull request Jul 10, 2025
### What problem does this PR solve?
relate pr: apache#52561
Fix CacheException msg in loadSnapshot to make
test_paimon_catalog.groovy happy
morningman added a commit to morningman/doris that referenced this pull request Jul 10, 2025
apache#52817)

Followup apache#52561
Also fix a bug introduced by apache#51471, which lost the function rules in
jdbc external table.
morningman pushed a commit to morningman/doris that referenced this pull request Jul 10, 2025
### What problem does this PR solve?
relate pr: apache#52561
Fix CacheException msg in loadSnapshot to make
test_paimon_catalog.groovy happy
morningman added a commit to morningman/doris that referenced this pull request Jul 10, 2025
apache#52817)

Followup apache#52561
Also fix a bug introduced by apache#51471, which lost the function rules in
jdbc external table.
morningman pushed a commit to morningman/doris that referenced this pull request Jul 10, 2025
### What problem does this PR solve?
relate pr: apache#52561
Fix CacheException msg in loadSnapshot to make
test_paimon_catalog.groovy happy
morningman added a commit to morningman/doris that referenced this pull request Jul 10, 2025
apache#52817)

Followup apache#52561
Also fix a bug introduced by apache#51471, which lost the function rules in
jdbc external table.
morningman pushed a commit to morningman/doris that referenced this pull request Jul 11, 2025
### What problem does this PR solve?
relate pr: apache#52561
Fix CacheException msg in loadSnapshot to make
test_paimon_catalog.groovy happy
morningman added a commit to morningman/doris that referenced this pull request Jul 11, 2025
apache#52817)

Followup apache#52561
Also fix a bug introduced by apache#51471, which lost the function rules in
jdbc external table.
morrySnow pushed a commit that referenced this pull request Jul 11, 2025
…ystem. #52561 #52817 #52881 #52989 (#53030)

bp (#52561)(#52817)(#52881)(#52989)

---------

Co-authored-by: Socrates <suyiteng@selectdb.com>
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.1.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants