Update binary records

This example pipeline demonstrates how to encode binary data (such as employee biodata) and update the corresponding employee records in the Snowflake database using the Snowflake - Update Snap.


Snowflake Update pipeline

  1. Configure the File Reader Snap to read the employee data file from the SnapLogic database.

    File Reader Configuration

  2. Configure the Binary to Document Snap to encode binary fields and the Snowflake - Select Snap to fetch existing records.

    In the Binary to Document Snap, select ENCODE_BASE64 in the Encode or Decode field to enable base64 encoding of binary data.


    Binary to Document Configuration


    Snowflake Select Configuration

  3. Configure the Join Snap to join both document streams.

    Use the Outer Join type to merge encoded and selected records from upstream Snaps.


    Join Snap Configuration

  4. Configure the Mapper Snap to prepare input data for the Snowflake - Update Snap.

    Ensure that the BIO and TEXT fields match the binary and varbinary format requirements of the Snowflake schema.


    Mapper Snap Configuration

  5. Configure the Snowflake - Update Snap to update employee records in the Snowflake database.

    Use the following update condition to convert the base64-encoded binary into a binary format and update the BIO field:

    BIO = to_binary( '"+$BIO+"','base64')

    Snowflake Update Snap Configuration

    After validation, the Snap updates the employee records in the Snowflake table with the encoded binary data.
    Snowflake Update Snap Configuration

  6. Format and write the output using JSON Formatter and File Writer Snaps.

    JSON Formatter Output


    File Writer Output