rahulsmahadev opened a new pull request, #17954:
URL: https://github.com/apache/iceberg/pull/17954

   Implements `TableCatalog.createTableLike` (added in Spark 4.2) for Iceberg's 
Spark catalogs, so `CREATE TABLE ... LIKE ...` creates an Iceberg table from an 
existing one.
   
   Spark's `CreateTableLikeExec` intentionally excludes the source table's 
properties from the `TableInfo` it passes, leaving the connector to decide what 
to clone via the `sourceTable` argument. This implementation:
   
   - clones the source Iceberg table's schema, partition spec, sort order, and 
table properties;
   - lets user-specified `TBLPROPERTIES` and `LOCATION` take precedence over 
the cloned values;
   - does not copy snapshots, data, or metadata history, and creates the new 
table at the catalog's default location unless `LOCATION` is given.
   
   `SparkSessionCatalog` routes `createTableLike` to the Iceberg catalog or the 
session catalog by provider, matching the existing create-table routing. 
Documentation is updated in `spark-ddl.md`.
   
   Tests cover schema / partition spec / sort-order / property cloning, 
`TBLPROPERTIES` override precedence, `IF NOT EXISTS`, and a missing source, 
across the Hive, Hadoop, session, and REST catalog configurations.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to