Santhosh
Santhosh

Reputation: 11798

snowflake: after cloning if i delete the oringal table what will happen

In snowflake i have the following structure

DB1
  -- schema1
  -- schema2
     -- table2

i want to create a copy of table2 in schema1

so i am thinking to do

CREATE or replace TABLE "SCHEMA1"."TABLE2_CLONE_FROM_SCHEMA1" CLONE "SCHEMA2"."TABLE2";

now i will see

DB1
  -- schema1
    -- table2_clone_from_schema1
  -- schema2
     -- table2

now if i delete table2 in schem2 will i loose table2_clone_from_schema1

Upvotes: 0

Views: 1458

Answers (1)

Gokhan Atil
Gokhan Atil

Reputation: 10079

Nothing will happen. Your new table stays there. When a table is deleted, Snowflake keeps the micro-partitions of this table if they are used by any cloned tables.

https://docs.snowflake.com/en/user-guide/tables-storage-considerations.html#cloning-tables-schemas-and-databases

Upvotes: 1

Related Questions