Skip to content

Conversation

@hubgeter
Copy link
Contributor

@hubgeter hubgeter commented Oct 15, 2025

What problem does this PR solve?

Problem Summary:
In the previous MaxCompute architecture, and its mapping in Doris, the hierarchy was: project / database -> table / table. When creating a catalog, users needed to specify the property mc.default.project, which indicated the default project to access. In this structure, executing SHOW DATABASES would list other projects.

After MaxCompute introduced the concept of schemas, the hierarchy changed to: project / catalog -> schema / database -> table / table. Here, the project is at a higher level, and SHOW DATABASES should now list all schemas under the current project. As a result, users need to create a separate catalog for each project, specifying a different mc.default.project property.
doc: https://help.aliyun.com/zh/maxcompute/user-guide/schema-related-operations?spm=a2c4g.11186623.help-menu-search-27797.d_0#9d8326491bagj

To maintain compatibility with the old version, a catalog property mc.project.schema.table is introduced:
- When the property is true, the new architecture is used.
- When the property is false, the old architecture is used.

Release note

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?

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?

@hubgeter
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-DS: Total hot run time: 190491 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 07d49ce7a7bf3cfa934cc9efe217ca00889868d3, data reload: false

query1	1099	433	416	416
query2	6558	1691	1706	1691
query3	6757	229	225	225
query4	26818	23827	23015	23015
query5	5279	654	492	492
query6	329	236	223	223
query7	4664	493	292	292
query8	296	261	259	259
query9	8735	2563	2563	2563
query10	523	346	277	277
query11	15472	15377	14806	14806
query12	189	119	117	117
query13	1682	580	424	424
query14	11730	9065	9199	9065
query15	226	190	179	179
query16	7665	682	532	532
query17	1552	791	623	623
query18	2099	467	393	393
query19	245	231	190	190
query20	153	149	134	134
query21	248	139	133	133
query22	4996	4855	4839	4839
query23	34961	33801	34222	33801
query24	8963	2516	2481	2481
query25	598	593	489	489
query26	1269	298	170	170
query27	2973	514	373	373
query28	5042	2257	2213	2213
query29	867	638	514	514
query30	308	224	210	210
query31	957	876	872	872
query32	84	78	72	72
query33	593	392	384	384
query34	868	879	537	537
query35	854	855	796	796
query36	1033	1051	986	986
query37	124	120	88	88
query38	3698	3675	3649	3649
query39	1484	1432	1458	1432
query40	215	123	121	121
query41	61	63	60	60
query42	118	114	105	105
query43	480	485	479	479
query44	1364	832	819	819
query45	178	182	174	174
query46	850	1000	642	642
query47	1833	1851	1757	1757
query48	389	416	327	327
query49	766	509	415	415
query50	651	684	405	405
query51	3881	3941	4046	3941
query52	113	111	98	98
query53	239	283	195	195
query54	601	595	535	535
query55	86	81	85	81
query56	343	346	322	322
query57	1212	1214	1142	1142
query58	290	299	278	278
query59	2517	2711	2582	2582
query60	360	346	339	339
query61	160	156	164	156
query62	816	784	674	674
query63	239	192	194	192
query64	4391	1154	844	844
query65	4043	3961	3996	3961
query66	1047	426	324	324
query67	15761	15420	15268	15268
query68	7855	947	597	597
query69	484	357	290	290
query70	1397	1310	1323	1310
query71	478	345	314	314
query72	5770	4886	4829	4829
query73	548	562	364	364
query74	8860	9221	8775	8775
query75	4268	3295	2844	2844
query76	4757	1160	730	730
query77	925	398	314	314
query78	9728	9902	8872	8872
query79	2630	853	602	602
query80	704	554	498	498
query81	494	272	231	231
query82	474	159	133	133
query83	302	265	243	243
query84	328	121	100	100
query85	881	462	424	424
query86	363	328	300	300
query87	3738	3764	3604	3604
query88	3502	2220	2230	2220
query89	402	326	300	300
query90	2060	213	217	213
query91	176	162	134	134
query92	95	68	66	66
query93	1217	994	655	655
query94	699	450	347	347
query95	393	320	314	314
query96	485	556	282	282
query97	2975	2989	2869	2869
query98	240	227	223	223
query99	1446	1402	1303	1303
Total cold run time: 283669 ms
Total hot run time: 190491 ms

@doris-robot
Copy link

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

query1	0.06	0.06	0.05
query2	0.09	0.06	0.06
query3	0.25	0.08	0.08
query4	1.61	0.12	0.12
query5	0.28	0.26	0.25
query6	1.18	0.64	0.64
query7	0.03	0.03	0.03
query8	0.06	0.04	0.04
query9	0.63	0.54	0.53
query10	0.59	0.58	0.58
query11	0.17	0.12	0.11
query12	0.17	0.12	0.12
query13	0.64	0.62	0.63
query14	1.02	1.03	1.02
query15	0.86	0.86	0.84
query16	0.40	0.40	0.40
query17	1.04	1.08	1.07
query18	0.23	0.20	0.20
query19	1.93	1.83	1.85
query20	0.02	0.01	0.02
query21	15.44	0.95	0.59
query22	0.75	1.06	0.63
query23	15.18	1.38	0.59
query24	7.37	1.12	0.45
query25	0.47	0.12	0.09
query26	0.64	0.17	0.15
query27	0.06	0.05	0.06
query28	8.99	1.35	0.91
query29	12.54	3.93	3.24
query30	0.29	0.14	0.11
query31	2.82	0.60	0.40
query32	3.25	0.57	0.49
query33	3.06	3.08	3.17
query34	16.10	5.42	4.83
query35	4.88	4.85	4.93
query36	0.68	0.51	0.51
query37	0.11	0.07	0.07
query38	0.07	0.05	0.05
query39	0.04	0.03	0.04
query40	0.19	0.16	0.14
query41	0.09	0.03	0.03
query42	0.03	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 104.36 s
Total hot run time: 29.95 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

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

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

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

if (getClient().schemas().exists(dbName)) {
List<Partition> parts;
if (limit < 0) {
parts = getClient().tables().get(defaultProject, dbName, tbl).getPartitions();
Copy link
Contributor

Choose a reason for hiding this comment

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

There are 9 places to call different version of getClient().tables().get().
I suggest to extract to a method in MCUtils.java

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i add a McStructureHelper interface to simple the logical of getclient().xxx

// a variable is introduced:
// - When the property is true, the new architecture is used.
// - When the property is false, the old architecture is used.
public static final String PROJECT_SCHEMA_TABLE = "mc.project.schema.table";
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest: mc.enable.namespace.schema

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix.

@hubgeter
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

query1	1070	462	429	429
query2	6570	1697	1702	1697
query3	6754	230	221	221
query4	26284	23519	23384	23384
query5	5230	649	465	465
query6	341	260	218	218
query7	4675	529	305	305
query8	291	268	249	249
query9	8713	2588	2623	2588
query10	573	347	315	315
query11	15415	15316	14874	14874
query12	186	120	115	115
query13	1681	542	433	433
query14	11490	9186	9312	9186
query15	210	197	176	176
query16	7688	702	521	521
query17	1595	786	629	629
query18	2089	501	381	381
query19	264	215	191	191
query20	148	132	128	128
query21	220	149	125	125
query22	4597	4594	4583	4583
query23	35057	33945	33759	33759
query24	9019	2706	2539	2539
query25	576	512	457	457
query26	1252	284	197	197
query27	4055	520	371	371
query28	4433	2289	2231	2231
query29	801	648	495	495
query30	306	240	202	202
query31	925	886	831	831
query32	77	85	78	78
query33	596	395	360	360
query34	830	891	543	543
query35	844	896	823	823
query36	988	1015	925	925
query37	126	119	107	107
query38	3795	3612	3467	3467
query39	1461	1441	1412	1412
query40	229	126	117	117
query41	62	59	56	56
query42	121	114	117	114
query43	477	491	466	466
query44	1214	741	736	736
query45	188	180	173	173
query46	904	999	637	637
query47	1755	1812	1721	1721
query48	412	447	330	330
query49	789	540	399	399
query50	648	693	417	417
query51	3841	3970	3896	3896
query52	113	110	97	97
query53	240	271	196	196
query54	601	585	523	523
query55	89	90	84	84
query56	302	336	299	299
query57	1167	1182	1153	1153
query58	283	273	277	273
query59	2655	2563	2567	2563
query60	366	351	345	345
query61	154	156	158	156
query62	794	761	669	669
query63	231	200	193	193
query64	4408	1168	812	812
query65	4049	3962	3986	3962
query66	1079	449	353	353
query67	15573	15226	15202	15202
query68	9667	894	597	597
query69	493	343	293	293
query70	1345	1266	1239	1239
query71	524	394	305	305
query72	5832	4886	4880	4880
query73	734	589	366	366
query74	9132	9073	8696	8696
query75	4577	3351	2821	2821
query76	4195	1146	735	735
query77	1030	411	320	320
query78	9723	9865	8971	8971
query79	2362	833	622	622
query80	666	566	505	505
query81	502	263	235	235
query82	478	159	128	128
query83	306	288	255	255
query84	304	122	105	105
query85	887	459	430	430
query86	347	314	311	311
query87	3722	3746	3748	3746
query88	3369	2291	2239	2239
query89	387	330	292	292
query90	2013	221	218	218
query91	163	167	134	134
query92	90	70	69	69
query93	1206	999	649	649
query94	698	426	348	348
query95	411	328	319	319
query96	494	574	286	286
query97	2967	2979	2955	2955
query98	244	217	218	217
query99	1446	1409	1288	1288
Total cold run time: 284283 ms
Total hot run time: 190526 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.09	0.04	0.04
query3	0.26	0.08	0.08
query4	1.61	0.12	0.11
query5	0.27	0.26	0.25
query6	1.17	0.67	0.65
query7	0.03	0.03	0.02
query8	0.06	0.05	0.04
query9	0.61	0.52	0.53
query10	0.59	0.59	0.58
query11	0.17	0.12	0.13
query12	0.16	0.13	0.12
query13	0.65	0.61	0.61
query14	1.03	1.04	1.03
query15	0.86	0.85	0.90
query16	0.43	0.39	0.39
query17	1.03	1.05	1.05
query18	0.21	0.20	0.20
query19	1.96	1.88	1.86
query20	0.02	0.01	0.01
query21	15.43	0.17	0.13
query22	5.16	0.06	0.04
query23	15.66	0.27	0.11
query24	2.88	0.85	1.18
query25	0.07	0.07	0.06
query26	0.15	0.13	0.13
query27	0.07	0.05	0.06
query28	5.06	1.16	0.95
query29	12.70	4.04	3.34
query30	0.27	0.13	0.12
query31	2.83	0.61	0.41
query32	3.24	0.55	0.48
query33	3.11	3.14	3.10
query34	16.15	5.48	4.84
query35	4.92	4.91	4.95
query36	0.70	0.52	0.50
query37	0.10	0.07	0.07
query38	0.07	0.04	0.04
query39	0.03	0.04	0.03
query40	0.17	0.15	0.15
query41	0.08	0.03	0.03
query42	0.04	0.03	0.02
query43	0.04	0.04	0.04
Total cold run time: 100.2 s
Total hot run time: 28.98 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

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

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

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

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

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@morningman morningman merged commit 890c778 into apache:master Oct 24, 2025
32 of 34 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 24, 2025
…ble. (#57012)

### What problem does this PR solve?
Problem Summary:
In the previous MaxCompute architecture, and its mapping in Doris, the
hierarchy was: `project / database -> table / table`. When creating a
catalog, users needed to specify the property `mc.default.project`,
which indicated the default project to access. In this structure,
executing `SHOW DATABASES` would list other projects.

After MaxCompute introduced the concept of schemas, the hierarchy
changed to: `project / catalog -> schema / database -> table / table`.
Here, the project is at a higher level, and `SHOW DATABASES` should now
list all schemas under the current project. As a result, users need to
create a separate catalog for each project, specifying a different
`mc.default.project` property.
doc:
https://help.aliyun.com/zh/maxcompute/user-guide/schema-related-operations?spm=a2c4g.11186623.help-menu-search-27797.d_0#9d8326491bagj

To maintain compatibility with the old version, a catalog property
`mc.project.schema.table` is introduced:
    - When the property is true, the new architecture is used.
    - When the property is false, the old architecture is used.
github-actions bot pushed a commit that referenced this pull request Oct 24, 2025
…ble. (#57012)

### What problem does this PR solve?
Problem Summary:
In the previous MaxCompute architecture, and its mapping in Doris, the
hierarchy was: `project / database -> table / table`. When creating a
catalog, users needed to specify the property `mc.default.project`,
which indicated the default project to access. In this structure,
executing `SHOW DATABASES` would list other projects.

After MaxCompute introduced the concept of schemas, the hierarchy
changed to: `project / catalog -> schema / database -> table / table`.
Here, the project is at a higher level, and `SHOW DATABASES` should now
list all schemas under the current project. As a result, users need to
create a separate catalog for each project, specifying a different
`mc.default.project` property.
doc:
https://help.aliyun.com/zh/maxcompute/user-guide/schema-related-operations?spm=a2c4g.11186623.help-menu-search-27797.d_0#9d8326491bagj

To maintain compatibility with the old version, a catalog property
`mc.project.schema.table` is introduced:
    - When the property is true, the new architecture is used.
    - When the property is false, the old architecture is used.
yiguolei pushed a commit that referenced this pull request Oct 24, 2025
…ct-schema-table. #57012 (#57287)

Cherry-picked from #57012

Co-authored-by: daidai <changyuwei@selectdb.com>
morrySnow pushed a commit that referenced this pull request Oct 30, 2025
…ct-schema-table. #57012 (#57286)

Cherry-picked from #57012

Co-authored-by: daidai <changyuwei@selectdb.com>
Hastyshell pushed a commit to Hastyshell/doris that referenced this pull request Nov 12, 2025
…alog read project-schema-table. apache#57012 (apache#5620)

cherry-picks from apache#57012
Related to apache#5289

Co-authored-by: daidai <changyuwei@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.0.x dev/3.1.3-merged dev/4.0.1-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants