Skip to content

[improvement](iceberg) Reconstruct partition spec in SHOW CREATE TABLE for Iceberg tables#63240

Merged
morningman merged 4 commits into
apache:masterfrom
nsivarajan:partition-spec
May 18, 2026
Merged

[improvement](iceberg) Reconstruct partition spec in SHOW CREATE TABLE for Iceberg tables#63240
morningman merged 4 commits into
apache:masterfrom
nsivarajan:partition-spec

Conversation

@nsivarajan
Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

SHOW CREATE TABLE for Iceberg external tables omitted the PARTITION BY LIST (...) () clause entirely. The generated DDL was not reproducible — running it as a new CREATE TABLE would create an unpartitioned table, silently losing the partition strategy.

Env.getDdlStmt() for ICEBERG_EXTERNAL_TABLE reconstructed ORDER BY and LOCATION from Iceberg metadata but had no code path for the partition spec.

Added getPartitionSpecSql() to IcebergExternalTable, which reads the live PartitionSpec from the Iceberg catalog and converts each PartitionField back to Doris DDL syntax. Wired into Env.getDdlStmt() between ORDER BY and LOCATION.

Transform mapping (all Iceberg standard transforms covered):

  • isIdentity() → col
  • isBucket(n) → BUCKET(n, col)
  • toString() = "truncate[n]" → TRUNCATE(n, col)
  • toString() = "year/month/day/hour" → YEAR/MONTH/DAY/HOUR(col)
  • isVoid() → skipped (dropped partition field from evolution)

Uses isVoid() and isIdentity() from the public Transform interface where available, falls back to the spec-defined canonical toString() names for remaining transforms (stable across all Iceberg versions as they are used in metadata serialisation).

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

Sivarajan Narayanan added 2 commits May 14, 2026 12:38
fix build for iceberg show create stmt for partition
@hello-stephen
Copy link
Copy Markdown
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?

@nsivarajan
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-H: Total hot run time: 29380 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit b44a3c2a22bbe6b2fb92d871cceec59907d7e3d6, 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	17660	3878	3830	3830
q2	q3	10704	875	604	604
q4	4661	466	354	354
q5	7470	1340	1147	1147
q6	216	171	142	142
q7	966	949	753	753
q8	10004	1403	1332	1332
q9	6177	5372	5361	5361
q10	6307	2083	1807	1807
q11	466	265	256	256
q12	697	414	292	292
q13	18265	3255	2719	2719
q14	293	284	264	264
q15	q16	903	873	792	792
q17	1041	1023	743	743
q18	6510	5749	5545	5545
q19	1760	1202	995	995
q20	501	396	257	257
q21	4690	2265	1881	1881
q22	424	356	306	306
Total cold run time: 99715 ms
Total hot run time: 29380 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	4241	4125	4098	4098
q2	q3	4618	4783	4167	4167
q4	2109	2144	1385	1385
q5	4920	4985	5250	4985
q6	189	165	132	132
q7	2041	2068	1667	1667
q8	3441	3202	3174	3174
q9	8471	8499	8409	8409
q10	4491	4490	4225	4225
q11	607	413	391	391
q12	693	757	511	511
q13	3248	3659	3003	3003
q14	305	314	274	274
q15	q16	764	776	716	716
q17	1335	1329	1383	1329
q18	8031	7122	7128	7122
q19	1148	1172	1140	1140
q20	2241	2275	1949	1949
q21	6077	5503	4965	4965
q22	587	505	469	469
Total cold run time: 59557 ms
Total hot run time: 54111 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-H: Total hot run time: 29362 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit b44a3c2a22bbe6b2fb92d871cceec59907d7e3d6, 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	17852	3955	3834	3834
q2	q3	10717	862	590	590
q4	4667	457	345	345
q5	7448	1305	1128	1128
q6	184	168	133	133
q7	901	960	736	736
q8	9409	1374	1233	1233
q9	6017	5359	5263	5263
q10	6299	2068	1821	1821
q11	475	259	251	251
q12	687	409	294	294
q13	18185	3302	2723	2723
q14	285	279	256	256
q15	q16	900	860	795	795
q17	1076	958	750	750
q18	6466	5747	5564	5564
q19	1525	1252	1110	1110
q20	509	395	265	265
q21	4664	2373	1956	1956
q22	453	384	315	315
Total cold run time: 98719 ms
Total hot run time: 29362 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	4652	4534	4542	4534
q2	q3	4686	4768	4257	4257
q4	2088	2202	1397	1397
q5	4931	5017	5231	5017
q6	196	167	129	129
q7	2051	1770	1619	1619
q8	3314	3121	3087	3087
q9	8452	8639	8469	8469
q10	4435	4434	4233	4233
q11	616	423	401	401
q12	743	757	549	549
q13	3269	3733	2919	2919
q14	310	328	303	303
q15	q16	756	806	683	683
q17	1326	1301	1260	1260
q18	7994	7178	7120	7120
q19	1139	1131	1155	1131
q20	2198	2197	1922	1922
q21	5990	5284	4749	4749
q22	516	474	399	399
Total cold run time: 59662 ms
Total hot run time: 54178 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

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

query5	4329	638	523	523
query6	314	228	197	197
query7	4225	552	320	320
query8	318	228	220	220
query9	8811	3956	3981	3956
query10	450	337	299	299
query11	5677	2410	2207	2207
query12	204	129	131	129
query13	1268	594	413	413
query14	6742	5315	5002	5002
query14_1	4310	4315	4305	4305
query15	213	198	178	178
query16	1026	414	429	414
query17	1132	753	627	627
query18	2716	468	353	353
query19	224	209	167	167
query20	142	138	135	135
query21	220	146	133	133
query22	13620	13491	13334	13334
query23	17230	16270	15976	15976
query23_1	16104	16195	16147	16147
query24	7363	1754	1377	1377
query24_1	1363	1350	1358	1350
query25	581	533	479	479
query26	840	319	177	177
query27	2678	589	348	348
query28	4392	1934	1914	1914
query29	1013	657	555	555
query30	305	239	197	197
query31	1134	1079	940	940
query32	88	82	77	77
query33	551	358	313	313
query34	1177	1090	650	650
query35	773	785	707	707
query36	1337	1386	1157	1157
query37	151	109	94	94
query38	3236	3124	3057	3057
query39	939	937	898	898
query39_1	883	869	870	869
query40	242	164	141	141
query41	75	68	69	68
query42	111	109	110	109
query43	327	329	286	286
query44	
query45	210	202	201	201
query46	1051	1182	732	732
query47	2365	2391	2242	2242
query48	406	426	299	299
query49	634	555	451	451
query50	715	284	230	230
query51	4323	4342	4280	4280
query52	108	111	103	103
query53	262	282	216	216
query54	332	302	282	282
query55	97	94	89	89
query56	329	331	347	331
query57	1486	1448	1378	1378
query58	319	293	283	283
query59	1581	1597	1438	1438
query60	385	335	322	322
query61	153	155	156	155
query62	680	611	556	556
query63	244	198	209	198
query64	1733	824	671	671
query65	
query66	1639	521	397	397
query67	30073	29892	29834	29834
query68	
query69	456	353	305	305
query70	1050	1022	985	985
query71	297	273	276	273
query72	3025	2707	2426	2426
query73	861	765	414	414
query74	5068	4872	4702	4702
query75	2758	2667	2326	2326
query76	2274	1121	807	807
query77	449	442	351	351
query78	12921	13002	12380	12380
query79	1491	1001	739	739
query80	1337	554	497	497
query81	525	276	241	241
query82	951	160	128	128
query83	324	272	251	251
query84	252	171	108	108
query85	908	538	449	449
query86	460	347	299	299
query87	3459	3375	3216	3216
query88	3528	2653	2626	2626
query89	446	387	341	341
query90	1871	185	184	184
query91	179	169	144	144
query92	81	75	73	73
query93	1174	948	588	588
query94	710	343	299	299
query95	665	377	341	341
query96	1051	742	333	333
query97	2693	2678	2566	2566
query98	236	232	226	226
query99	1115	1146	1027	1027
Total cold run time: 253407 ms
Total hot run time: 170023 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 0.52% (5/961) 🎉
Increment coverage report
Complete coverage report

@nsivarajan
Copy link
Copy Markdown
Contributor Author

run external

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 0.43% (5/1162) 🎉
Increment coverage report
Complete coverage report

morningman
morningman previously approved these changes May 17, 2026
@morningman
Copy link
Copy Markdown
Contributor

/review

@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

I found a correctness issue in the new SHOW CREATE TABLE partition-spec rendering for Iceberg tables: partition column names are emitted as raw SQL identifiers, so valid Iceberg/Doris quoted column names can produce non-replayable or semantically different DDL.

Critical checkpoint conclusions:

  • Goal/test: The PR aims to include Iceberg partition specs in SHOW CREATE TABLE and adds unit coverage for common transforms. The goal is only partially met because replayability is not covered for quoted/reserved/special column names.
  • Scope: The implementation is small and focused, with the same hook added to both DDL generation paths.
  • Concurrency/lifecycle: No new shared mutable state, locks, threads, or non-obvious lifecycle management were introduced.
  • Config/compatibility/persistence: No new config, persisted metadata, FE-BE protocol, or storage-format compatibility changes.
  • Parallel paths: Both Iceberg SHOW CREATE paths in Env were updated.
  • Tests: Unit tests cover transform formatting, but miss identifier quoting/replay parsing cases and unsupported/edge partition fields.
  • Observability: No new runtime critical path requiring metrics; warning-only behavior for skipped transforms may still hide non-replayable DDL.
  • Performance: No material performance concern for SHOW CREATE; repeated schema lookups are minor.

User focus: No additional user-provided review focus was present.

@nsivarajan nsivarajan changed the title [improvement] (iceberg) Reconstruct partition spec in SHOW CREATE TABLE for Iceberg tables [improvement](iceberg) Reconstruct partition spec in SHOW CREATE TABLE for Iceberg tables May 17, 2026
@github-actions github-actions Bot removed the approved Indicates a PR has been approved by one committer. label May 17, 2026
@nsivarajan
Copy link
Copy Markdown
Contributor Author

run buildall

@nsivarajan nsivarajan requested a review from morningman May 17, 2026 18:47
@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-H: Total hot run time: 31295 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 9f991a88784c4e80be366439898b090b172d2ef7, 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	17716	3885	3823	3823
q2	q3	10779	1382	793	793
q4	4679	474	339	339
q5	7601	2236	2130	2130
q6	356	180	142	142
q7	919	783	621	621
q8	9405	1729	1611	1611
q9	7016	4926	4951	4926
q10	6415	2103	1763	1763
q11	440	279	247	247
q12	688	434	294	294
q13	18190	3344	2763	2763
q14	260	258	246	246
q15	q16	820	765	701	701
q17	961	951	1077	951
q18	6724	5622	5622	5622
q19	1195	1257	1150	1150
q20	552	428	282	282
q21	5954	2745	2566	2566
q22	437	387	325	325
Total cold run time: 101107 ms
Total hot run time: 31295 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	4699	4612	4760	4612
q2	q3	4821	5197	4637	4637
q4	2143	2199	1397	1397
q5	5070	4771	4678	4678
q6	228	176	132	132
q7	1838	1720	1546	1546
q8	2419	2113	1962	1962
q9	7295	7304	7248	7248
q10	4494	4388	3970	3970
q11	531	386	358	358
q12	703	714	510	510
q13	2992	3399	2750	2750
q14	265	278	251	251
q15	q16	680	697	623	623
q17	1249	1236	1234	1234
q18	7321	6811	6985	6811
q19	1132	1107	1077	1077
q20	2221	2230	1936	1936
q21	5287	4609	4423	4423
q22	523	459	416	416
Total cold run time: 55911 ms
Total hot run time: 50571 ms

@morningman
Copy link
Copy Markdown
Contributor

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Review result: request changes.

Critical checkpoints:

  • Goal/test: The PR aims to make Iceberg SHOW CREATE TABLE include partition specs, and unit tests cover direct getPartitionSpecSql conversion. However, the Env wiring also applies to Iceberg system metadata tables, where the generated DDL no longer matches the table being shown.
  • Scope/focus: The implementation is small, but the source-table reuse in the sys-table branch makes the new behavior broader than intended.
  • Concurrency/lifecycle: No new shared mutable state or lifecycle-sensitive static initialization was introduced.
  • Config/compatibility: No new config, persistence format, or FE-BE protocol change.
  • Parallel paths: Both Env DDL paths were updated, but both share the same system-table correctness issue.
  • Tests: Added unit tests exercise transform formatting, but they do not cover SHOW CREATE TABLE through Env or IcebergSysExternalTable.
  • Observability/performance: No new hot path or observability requirement identified.
  • User focus: No additional user-provided review focus was specified.

I did not repeat the existing review thread about quoting/escaping partition column names.

Comment thread fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java Outdated
@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 171531 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 9f991a88784c4e80be366439898b090b172d2ef7, data reload: false

query5	4322	682	531	531
query6	346	222	217	217
query7	4217	581	320	320
query8	325	237	223	223
query9	8829	4059	4062	4059
query10	456	350	307	307
query11	5803	2467	2234	2234
query12	186	132	132	132
query13	1286	630	429	429
query14	6121	5409	5101	5101
query14_1	4430	4403	4378	4378
query15	220	212	189	189
query16	996	464	455	455
query17	1162	762	641	641
query18	2557	511	368	368
query19	260	199	160	160
query20	139	132	128	128
query21	214	144	121	121
query22	13654	13564	13480	13480
query23	17319	16250	15939	15939
query23_1	16136	16194	16022	16022
query24	7493	1768	1325	1325
query24_1	1328	1319	1301	1301
query25	565	499	428	428
query26	1311	322	174	174
query27	2698	564	346	346
query28	4481	1973	1935	1935
query29	996	653	505	505
query30	308	244	197	197
query31	1123	1054	931	931
query32	91	77	73	73
query33	533	355	331	331
query34	1200	1173	650	650
query35	769	778	683	683
query36	1300	1338	1135	1135
query37	151	107	91	91
query38	3235	3139	3079	3079
query39	935	932	896	896
query39_1	876	880	872	872
query40	227	150	131	131
query41	66	63	65	63
query42	110	123	111	111
query43	325	340	293	293
query44	
query45	214	202	195	195
query46	1101	1232	726	726
query47	2202	2267	2149	2149
query48	386	422	300	300
query49	632	500	411	411
query50	1048	365	262	262
query51	4328	4319	4295	4295
query52	104	112	101	101
query53	264	304	222	222
query54	328	294	262	262
query55	95	95	87	87
query56	344	331	320	320
query57	1430	1408	1364	1364
query58	314	292	282	282
query59	1637	1706	1499	1499
query60	343	357	337	337
query61	216	175	182	175
query62	677	642	577	577
query63	248	211	219	211
query64	2476	864	722	722
query65	
query66	1743	498	392	392
query67	30073	30050	29837	29837
query68	
query69	480	354	318	318
query70	1033	1015	1034	1015
query71	332	342	273	273
query72	3158	2768	2442	2442
query73	851	809	443	443
query74	5054	4877	4722	4722
query75	2730	2606	2246	2246
query76	2270	1180	796	796
query77	420	419	336	336
query78	12061	12174	11583	11583
query79	1459	1006	748	748
query80	810	564	463	463
query81	477	279	241	241
query82	1351	159	127	127
query83	356	326	254	254
query84	259	148	111	111
query85	942	552	470	470
query86	446	343	335	335
query87	3392	3364	3217	3217
query88	3575	2666	2681	2666
query89	456	390	342	342
query90	1790	192	183	183
query91	187	170	147	147
query92	85	80	74	74
query93	1466	1483	863	863
query94	619	348	327	327
query95	677	389	436	389
query96	1053	829	328	328
query97	2681	2690	2590	2590
query98	241	233	229	229
query99	1109	1100	970	970
Total cold run time: 254082 ms
Total hot run time: 171531 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 80.95% (34/42) 🎉
Increment coverage report
Complete coverage report

@nsivarajan
Copy link
Copy Markdown
Contributor Author

This PR followed , getSortOrderSql() pattern - missed on edge case, now a new commit fixes it. fixing getSortOrderSql() will be done in next PR

@nsivarajan
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 77.27% (34/44) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-H: Total hot run time: 31296 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 466370175297c648477903a35041da31c9474bd1, 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	17754	3994	3816	3816
q2	q3	10806	1347	827	827
q4	4689	475	347	347
q5	7631	2282	2143	2143
q6	242	175	144	144
q7	951	799	621	621
q8	9451	1747	1644	1644
q9	5183	4914	4914	4914
q10	6377	2061	1804	1804
q11	450	270	242	242
q12	634	434	298	298
q13	18100	3394	2804	2804
q14	259	250	235	235
q15	q16	829	766	697	697
q17	946	949	906	906
q18	6912	5614	5568	5568
q19	1193	1181	1033	1033
q20	519	405	295	295
q21	5874	2859	2629	2629
q22	453	396	329	329
Total cold run time: 99253 ms
Total hot run time: 31296 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	4753	4542	4567	4542
q2	q3	4926	5229	4633	4633
q4	2129	2207	1414	1414
q5	4851	4595	4600	4595
q6	227	176	144	144
q7	1945	1716	1553	1553
q8	2373	2025	2042	2025
q9	7757	7332	7168	7168
q10	4470	4393	3956	3956
q11	523	381	346	346
q12	713	715	513	513
q13	3038	3371	2823	2823
q14	283	271	256	256
q15	q16	677	697	619	619
q17	1249	1236	1235	1235
q18	7254	6986	6814	6814
q19	1095	1107	1117	1107
q20	2219	2204	1939	1939
q21	5334	4602	4500	4500
q22	520	447	408	408
Total cold run time: 56336 ms
Total hot run time: 50590 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 170073 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 466370175297c648477903a35041da31c9474bd1, data reload: false

query5	4312	649	499	499
query6	329	215	199	199
query7	4284	580	316	316
query8	321	226	224	224
query9	8810	4005	3979	3979
query10	446	337	291	291
query11	5772	2403	2213	2213
query12	187	128	125	125
query13	1282	622	418	418
query14	5955	5350	5052	5052
query14_1	4325	4342	4307	4307
query15	221	198	183	183
query16	1017	447	421	421
query17	1059	726	584	584
query18	2467	466	359	359
query19	228	219	190	190
query20	147	133	132	132
query21	213	144	125	125
query22	13630	13624	13410	13410
query23	17196	16423	16023	16023
query23_1	16153	16098	16177	16098
query24	7495	1772	1288	1288
query24_1	1296	1290	1297	1290
query25	582	489	439	439
query26	1322	311	183	183
query27	2674	595	350	350
query28	4478	1985	1938	1938
query29	996	641	522	522
query30	304	233	201	201
query31	1117	1078	950	950
query32	101	79	76	76
query33	564	380	327	327
query34	1148	1092	638	638
query35	757	791	665	665
query36	1317	1345	1185	1185
query37	154	109	94	94
query38	3227	3170	3059	3059
query39	942	944	905	905
query39_1	882	887	885	885
query40	237	152	136	136
query41	73	70	69	69
query42	115	112	116	112
query43	324	331	287	287
query44	
query45	216	209	198	198
query46	1086	1160	743	743
query47	2299	2322	2133	2133
query48	396	437	303	303
query49	646	512	402	402
query50	971	356	253	253
query51	4265	4223	4249	4223
query52	111	110	100	100
query53	263	289	212	212
query54	328	293	279	279
query55	96	95	89	89
query56	331	334	313	313
query57	1403	1406	1333	1333
query58	319	285	302	285
query59	1582	1599	1389	1389
query60	323	328	306	306
query61	149	154	151	151
query62	669	627	565	565
query63	255	205	206	205
query64	2427	788	625	625
query65	
query66	1741	469	363	363
query67	30072	29927	29870	29870
query68	
query69	462	346	309	309
query70	1044	991	1028	991
query71	314	277	271	271
query72	2965	2748	2415	2415
query73	866	730	438	438
query74	5082	4907	4741	4741
query75	2693	2600	2260	2260
query76	2312	1117	761	761
query77	393	417	325	325
query78	12285	12166	11694	11694
query79	1461	1028	742	742
query80	657	576	443	443
query81	459	277	248	248
query82	1386	159	128	128
query83	355	274	244	244
query84	278	137	111	111
query85	898	546	457	457
query86	397	337	291	291
query87	3422	3386	3222	3222
query88	3547	2657	2651	2651
query89	446	389	340	340
query90	1887	174	179	174
query91	173	170	137	137
query92	76	77	72	72
query93	1484	1437	946	946
query94	550	364	304	304
query95	660	467	344	344
query96	1077	730	338	338
query97	2714	2698	2560	2560
query98	241	229	232	229
query99	1097	1084	987	987
Total cold run time: 253021 ms
Total hot run time: 170073 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

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

@nsivarajan
Copy link
Copy Markdown
Contributor Author

run cloud_p0

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

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

@nsivarajan
Copy link
Copy Markdown
Contributor Author

@morningman Please could you assist with review and merging this PR.

@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label May 18, 2026
@morningman
Copy link
Copy Markdown
Contributor

/review

@morningman morningman merged commit 8a4f118 into apache:master May 18, 2026
33 checks passed
github-actions Bot pushed a commit that referenced this pull request May 18, 2026
…E for Iceberg tables (#63240)

### What problem does this PR solve?

Problem Summary:

`SHOW CREATE TABLE` for Iceberg external tables omitted the `PARTITION
BY LIST (...) ()` clause entirely. The generated DDL was not
reproducible — running it as a new `CREATE TABLE` would create an
unpartitioned table, silently losing the partition strategy.

`Env.getDdlStmt()` for `ICEBERG_EXTERNAL_TABLE` reconstructed `ORDER BY`
and `LOCATION` from Iceberg metadata but had no code path for the
partition spec.
  
Added `getPartitionSpecSql()` to `IcebergExternalTable`, which reads the
live `PartitionSpec` from the Iceberg catalog and converts each
`PartitionField` back to Doris DDL syntax. Wired into `Env.getDdlStmt()`
between `ORDER BY` and `LOCATION`.

*Transform mapping* (all Iceberg standard transforms covered):
  -  isIdentity() → col
  -  isBucket(n) → BUCKET(n, col)
  -  toString() = "truncate[n]" → TRUNCATE(n, col)
  -  toString() = "year/month/day/hour" → YEAR/MONTH/DAY/HOUR(col)
  -  isVoid() → skipped (dropped partition field from evolution)

Uses `isVoid()` and `isIdentity()` from the public `Transform` interface
where available, falls back to the spec-defined canonical `toString()`
names for remaining transforms (stable across all Iceberg versions as
they are used in metadata serialisation).


Co-authored-by: Sivarajan Narayanan <narayanan_sivarajan@apple.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/4.1.x reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants