Skip to main content

Snowflake

Overview

The Snowflake source allows you to sync data from Snowflake. It supports both Full Refresh and Incremental syncs. You can choose whether this connector will copy only new or updated data, or all rows in the tables and columns you set up for replication, every time a sync is run.

This Snowflake source connector is built on top of the source-jdbc code base and is configured to rely on JDBC 3.23.1 Snowflake driver as described in the Snowflake documentation.

Resulting schema

The Snowflake source does not alter the schema present in your warehouse. Depending on the destination connected to this source, however, the result schema may be altered. See the destination's documentation for more details.

Features

FeatureSupported?(Yes/No)Notes
Full Refresh SyncYes
Incremental - Append SyncYes
NamespacesYes

Incremental Sync

The Snowflake source connector supports incremental sync, which allows you to replicate only new or updated data since the last sync. This is accomplished using a cursor field that tracks the state of the sync.

How Incremental Sync Works

During incremental sync, the connector:

  1. Identifies new records: Uses a WHERE cursor_field > last_cursor_value clause to fetch only records newer than the last synced value
  2. Maintains order: Applies ORDER BY cursor_field ASC to ensure records are processed in the correct sequence
  3. Tracks state: Stores the maximum cursor value from each sync to use as the starting point for the next sync

Supported Cursor Field Data Types

The connector supports the following JDBC data types as cursor fields:

Date and Time Types:

  • TIMESTAMP_WITH_TIMEZONE
  • TIMESTAMP
  • TIME_WITH_TIMEZONE
  • TIME
  • DATE

Numeric Types:

  • TINYINT
  • SMALLINT
  • INTEGER
  • BIGINT
  • FLOAT
  • DOUBLE
  • REAL
  • NUMERIC
  • DECIMAL

String Types:

  • NVARCHAR
  • VARCHAR
  • LONGVARCHAR

Choosing a Cursor Field

For effective incremental sync, choose cursor fields that:

  • Are monotonically increasing: Values should always increase over time (e.g., auto-incrementing IDs, creation timestamps)
  • Are never updated: Avoid fields that might be modified after record creation
  • Have unique values: While duplicate values are handled, they can cause records to be skipped or re-synced
  • Are indexed: For better query performance on large tables

Good cursor field examples:

  • CREATED_AT or UPDATED_AT timestamp columns
  • Auto-incrementing ID columns
  • Sequence-generated numeric fields

Avoid using:

  • Fields that can be updated after creation
  • Fields with many duplicate values
  • Fields that can contain NULL values

Snowflake-Specific Considerations

Timezone Handling: The connector provides special handling for Snowflake's TIMESTAMPLTZ (timestamp with local timezone) data type, automatically converting it to TIMESTAMP_WITH_TIMEZONE for consistent processing.

Data Type Precision: Snowflake's numeric types maintain their precision during sync. Ensure your destination can handle the precision of your cursor fields.

Configuring Incremental Sync

To set up incremental sync in Calabi Connect:

  1. Create or edit your connection in the Calabi Connect UI
  2. Select your source tables that you want to sync incrementally
  3. Choose "Incremental | Append" sync mode for each table
  4. Select a cursor field from the dropdown list of available fields
  5. Verify the cursor field meets the criteria listed above (monotonically increasing, never updated, etc.)

The Calabi Connect UI will automatically validate that your chosen cursor field is compatible with incremental sync and will show you the supported data types for your specific table schema.

Troubleshooting Incremental Sync

Cursor field validation errors: If you receive an error about an invalid cursor field, ensure the field exists in your table and is one of the supported data types listed above.

Duplicate cursor values: When multiple records have the same cursor value, the connector processes all records with that value. This may result in some records being synced multiple times across different sync runs.

NULL cursor values: Records with NULL cursor field values are excluded from incremental sync. Ensure your cursor field has a NOT NULL constraint or default value.

State reset: If you need to re-sync all data, you can reset the connection's state in the Calabi Connect UI, which will cause the next sync to behave like a full refresh.

Getting started

Requirements

You'll need the following information to configure the Snowflake source:

  1. Host
  2. Role
  3. Warehouse
  4. Database
  5. Schema
  6. Username
  7. Password
  8. JDBC URL Params (Optional)

Additionally, create a dedicated read-only Calabi Connect user and role with access to all schemas needed for replication.

Setup guide

Connection parameters

Additional information about Snowflake connection parameters can be found in the Snowflake documentation.

This step is optional but highly recommended for better permission control and auditing. Alternatively, you can use Calabi Connect with an existing user in your database.

To create a dedicated database user, run the following commands against your database:

-- set variables (these need to be uppercase)
SET AIRBYTE_ROLE = 'AIRBYTE_ROLE';
SET AIRBYTE_USERNAME = 'AIRBYTE_USER';

-- set user password
SET AIRBYTE_PASSWORD = '-password-';

BEGIN;

-- create Airbyte role
CREATE ROLE IF NOT EXISTS $AIRBYTE_ROLE;

-- create Airbyte user
CREATE USER IF NOT EXISTS $AIRBYTE_USERNAME
PASSWORD = $AIRBYTE_PASSWORD
DEFAULT_ROLE = $AIRBYTE_ROLE
DEFAULT_WAREHOUSE= $AIRBYTE_WAREHOUSE;

-- grant Airbyte schema access
GRANT OWNERSHIP ON SCHEMA $AIRBYTE_SCHEMA TO ROLE $AIRBYTE_ROLE;

COMMIT;

You can limit this grant to specific schemas instead of the whole database. Note that to replicate data from multiple Snowflake databases, you can re-run the command above to grant access to all the relevant schemas, but you'll need to set up multiple sources connecting to the same database on multiple schemas.

Your database user should now be ready for use with Calabi Connect.

Authentication

Login and Password

FieldDescription
HostThe host domain of the snowflake instance (must include the account, region, cloud environment, and end with snowflakecomputing.com). Example: accountname.us-east-2.aws.snowflakecomputing.com
RoleThe role you created for Calabi Connect to access Snowflake. Example: AIRBYTE_ROLE
WarehouseThe warehouse you created for Calabi Connect to sync data into. Example: AIRBYTE_WAREHOUSE
DatabaseThe database you created for Calabi Connect to sync data into. Example: AIRBYTE_DATABASE
SchemaThe schema whose tables this replication is targeting. If no schema is specified, all tables with permission will be presented regardless of their schema.
UsernameThe username you created to allow Calabi Connect to access the database. Example: AIRBYTE_USER
PasswordThe password associated with the username.
JDBC URL Params (Optional)Additional properties to pass to the JDBC URL string when connecting to the database formatted as key=value pairs separated by the symbol &. Example: key1=value1&key2=value2&key3=value3

Key pair authentication

Network policies

By default, Snowflake allows users to connect to the service from any computer or device IP address. A security administrator (i.e. users with the SECURITYADMIN role) or higher can create a network policy to allow or deny access to a single IP address or a list of addresses.

If you have any issues connecting with Calabi Connect, please make sure that the list of IP addresses is on the allowed list.

To determine whether a network policy is set on your account or for a specific user, execute the SHOW PARAMETERS command.

Account

SHOW PARAMETERS LIKE 'network_policy' IN ACCOUNT;

User

SHOW PARAMETERS LIKE 'network_policy' IN USER <username>;

To read more, please check the official Snowflake documentation.