Snowflake Table Settings
When publishing to Snowflake, please complete the following steps to configure the table and settings to apply to the publish action.
Steps:
Select location: Navigate the Snowflake browser to select the database and table to which to publish.
To create a new table, click Create a new table.
Select table options:
Table name:
New table: Enter a name for it. You may use a pre-existing table name, and schema checks are performed against it.
Existing table: You cannot modify the name.
Publish actions: Select one of the following.
Append to this table every run: Each run adds any new results to the end of the table.
Truncate the table every run: With each run, all data in the table is truncated and replaced with any new results.
Drop the table every run: With each run, the table is dropped (deleted), and all data is deleted. A new table with the same name is created, and any new results are added to it.
Merge the table every run: This publishing option merges the rows in your results with any existing rows in the target Snowflake table. For more information, see Merge Table Operations below.
To save the publishing action, click Add or Update.
Merge Table Operations
Note
When a merge operation is performed on a Snowflake table, profiling information displayed in the Job Details page is incorrectly based on source data. Downloaded profile information is accurate. This is a known issue. As a workaround, you can create a second flow whose input is the output of the first. This flow can be run when profiling information is needed. See Build Sequence of Datasets.
The publishing option to merge table with every run allows you to update existing rows of data in the target table with corresponding values from your results (merge) and optionally to insert or delete matching rows from your results into the table.
Steps:
In the Table Settings panel, select Merge the table every run.
Primary keys for matching: Select one or more columns whose values determine if a row in your source results matches a row in the target. When these key values match, the following columns are updated.
Note
Columns of Object data type cannot be used as key columns for merge operations.
Note
Null values in a key column in the generated output are not considered matches with null values in the key columns of the target table. Instead, the merge operation inserts a new row in the target table containing only the values from the generated output.
If the matching columns have duplicate rows in the target table, all rows in the target are updated.
If the matching columns have duplicate rows in the source, the job fails.
Keys to be updated: Select one or more columns whose values are updated from your source results when values from the previous set of columns match. These are the columns that are merged into the table.
Tip
If All Columns is selected, all columns other than the matching columns are updated on a match. All columns continue to be updated even if the schema changes, and the matching columns remain in the schema.
Action on target table for matched rows: Select the action to apply to the target record when a match is found between the key columns:
Update: The values from your results are updated into the columns specified below.
Delete: The row in the target table is deleted.
Insert source rows if no match in target:
When selected, rows in your source that do not have a matching set of values in key columns are inserted into the table as new rows.
When deselected, these unmatched rows are not written to the target table.
Delete target rows if no match in source:
When selected, all rows in the target that do not have a matching set of key fields your source results are deleted.
When deselected, unmatched rows in the target are not deleted.