Skip to content

[spark] Support CREATE TABLE LIKE#7663

Open
Zouxxyy wants to merge 3 commits intoapache:masterfrom
Zouxxyy:dev/add-create-table-like
Open

[spark] Support CREATE TABLE LIKE#7663
Zouxxyy wants to merge 3 commits intoapache:masterfrom
Zouxxyy:dev/add-create-table-like

Conversation

@Zouxxyy
Copy link
Copy Markdown
Contributor

@Zouxxyy Zouxxyy commented Apr 16, 2026

Purpose

Adds support for CREATE TABLE LIKE in Paimon Spark integration (Spark 3.4+). Introduces PaimonCreateTableLikeCommand and RewriteCreateTableLikeCommand to copy schema, partitioning, and properties from a source table. Supports SparkCatalog and SparkGenericCatalog. When source and target providers match, copies comment and properties; otherwise only copies the comment.

Tests

  • DDLTestBase — CREATE TABLE LIKE with Paimon SparkCatalog
  • DDLWithHiveCatalogTestBase — CREATE TABLE LIKE with SparkGenericCatalog
  • PaimonFormatTableTest — FormatTable property copying

@LinMingQiang
Copy link
Copy Markdown
Contributor

Is it possible to support creating a new table from a branch?

@Zouxxyy
Copy link
Copy Markdown
Contributor Author

Zouxxyy commented Apr 17, 2026

This is supported now. I added a test to verify CREATE TABLE LIKE works with a branch source like source_tbl$branch_test_branch under SparkCatalog, and the target table is created from the branch metadata rather than the main table metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants