File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1077,10 +1077,11 @@ def clone_table(
10771077 raise NotImplementedError (f"Engine does not support cloning: { type (self )} " )
10781078
10791079 kwargs .pop ("rendered_physical_properties" , None )
1080+ table_kind = kwargs .pop ("table_kind" , "TABLE" )
10801081 self .execute (
10811082 exp .Create (
10821083 this = exp .to_table (target_table_name ),
1083- kind = "TABLE" ,
1084+ kind = table_kind ,
10841085 replace = replace ,
10851086 exists = exists ,
10861087 clone = exp .Clone (
Original file line number Diff line number Diff line change @@ -675,6 +675,12 @@ def clone_table(
675675 if isinstance (table_type , exp .TransientProperty ):
676676 kwargs ["properties" ] = exp .Properties (expressions = [table_type ])
677677
678+ # Snowflake requires CREATE ICEBERG TABLE ... CLONE for Iceberg tables
679+ # instead of the regular CREATE TABLE ... CLONE
680+ table_format = kwargs .pop ("table_format" , None )
681+ if table_format and isinstance (table_format , str ) and table_format .upper () == "ICEBERG" :
682+ kwargs ["table_kind" ] = f"{ table_format .upper ()} TABLE"
683+
678684 super ().clone_table (
679685 target_table_name ,
680686 source_table_name ,
Original file line number Diff line number Diff line change @@ -1085,6 +1085,7 @@ def _clone_snapshot_in_dev(
10851085 target_table_name ,
10861086 snapshot .table_name (),
10871087 rendered_physical_properties = rendered_physical_properties ,
1088+ table_format = snapshot .model .table_format ,
10881089 )
10891090 self ._migrate_target_table (
10901091 target_table_name = target_table_name ,
You can’t perform that action at this time.
0 commit comments