Use Case: Move Data Using Snowflake Snap Pack

In this article

Load Data From PostgreSQL to Snowflake

Overview

Loading data between data warehouses is a standard business requirement within an enterprise ecosystem. To accomplish this task efficiently, employing the appropriate tools and platforms is essential, considering that specific details might vary, and they rely on versions and configurations.

Problem

Loading data from PostgreSQL to Snowflake is manual in a real business case scenario. This data transfer is time-consuming if the data volume is high, and there is always the chance of a human error, which could impact customer relations.

Consider these factors when you manually move the data between the two databases:

  • Ensure the datatypes are mapped correctly between PostgreSQL and Snowflake.

  • Manage the transformations or adjustments needed for schema differences.

  • Monitor and optimize performance, especially when you are dealing with large datasets.

  • Schedule the transfer at regular intervals or as needed.

Solution

This pipeline below covers almost every challenge mentioned above that you might encounter when you manually transfer the data.

Download this solution

Understanding the Solution

In the initial phase, the pipeline truncates any pre-existing table in the Snowflake environment to prevent the creation of multiple tables. Subsequently, a specific table is chosen from the PostgreSQL database for data transfer, and this information is stored in the variables in the Mapper Snap. Next, the data is inserted into a newly created table in the Snowflake environment. To ensure the accuracy of the data transfer, the transferred data is retrieved from the Snowflake table for validation.

Steps

Step 1: Configure the Snowflake-Execute Snap with the truncate query to delete the existing tables in the Snowflake database.

Step 2: Configure the PostgreSQL - Select Snap with the required table from where you must transfer data.

Step 3: Configure the Mapper Snap to store the values of required columns of the table in specific variables as follows:

 

Step 4: Configure the Snowflake - Insert Snap to insert the extracted data from PostgreSQL into the Snowflake database in the C12284263 table.

Step 5: Configure the Snowflake - Execute Snap to verify that the data is successfully loaded. On validation, the Snowflake-Execute Snap displays the required data in the output preview.

 

 

Downloads

  File Modified

File Use_Case_Postgre_to_Snowflake.slp

Nov 21, 2023 by Lakshmi Manda