Upsert records

This example Pipeline demonstrates how you can efficiently update and delete data (rows) using the Key Column ID field and Upsert Delete condition. We use Snowflake - Bulk Upsert Snap to accomplish this task.


Snowflake Bulk Upsert Pipeline

  1. Configure the Mapper Snap with the required details to pass them as inputs to the downstream Snap.
    Mapper Snap Configuration

    After validation, the Mapper Snap prepares the output as shown below to pass to the Snowflake Bulk - Upsert Snap.


    Mapper Snap Output

  2. Configure the Snowflake - Bulk Upsert Snap to:
    • Upsert the existing row for P_ID column, (so, we provide P_ID in the Key column field).
    • Delete the rows where the FIRSTNAME is snaplogic in the target table, (so, we specify FIRSTNAME = 'snaplogic' in the Delete Upsert Condition field).

    Mapper Snap Output

    After execution, this Snap inserts a new record into the existing row for the P_ID key column in Snowflake.
    Bulk Upsert Output

    Upon execution, if the Delete Upsert condition is true, the Snap deletes the records in the target table as shown below.
    Inserted Columns