merging tables in snowflake
Our use case:
1. Create a copy of all the tables in staging schema(basically cloning tables from production).
2. Compare the cloned tables with the new tables(From source)
a. if there are updates
->update the cloned table in staging
b. if there are new rows,
->insert them into the cloned table
b. if there are no updates,
->don't make any changes
3. Move the cloned table into production.
Question 1: Can we achieve this using table update component?
Question 2: If so, how can we use variables to hold all the columns of respective tables when using variable(We want to avoid giving names of the columns manually each time)
Question 3: How to merge all the columns of the tables in the when matched case in table update component