About Snowflake data source
This article describes how to import your Snowflake data into Tealium.
The Snowflake data source is in Early Access and is only available to select customers. If you are interested in trying this feature, contact your Tealium Support representative.
Requirements
This feature requires the following:
- Tealium EventStream or Tealium AudienceStream
- Snowflake account
- Snowflake role with
USAGE
privileges
How it works
Use the Snowflake data source to import bulk data from a Snowflake table or view at near real-time speeds. After you import your data, transform and map it to Tealium attributes and build better audiences for targeted activation.
To get started, create one Snowflake data source per Snowflake table or view and customize the query mode and SQL WHERE
clause for your data set. Then map your database columns to Tealium attributes. Each imported row from a Snowflake source is processed as an event in Tealium.
Rate limits
Imports from Snowflake are typically limited to 50 events per second per account, but may vary. Standard attribute size limits still apply. For more information, see About attributes > Size limits
The Snowflake data source fetches data at a maximum of 1,000 rows at a time.
Snowflake tables
Each Snowflake data source supports importing data from one Snowflake table or view. To import data from multiple Snowflake tables, create a view in Snowflake and select the view in the data source configuration. For more information about views in Snowflake, see Snowflake: Overview of Views.
Data types
The Snowflake data source supports all Snowflake data types. To ensure data is imported correctly, map the Snowflake data types according to the following guidelines:
Snowflake | Tealium |
---|---|
Numeric data types | Number attributes |
String and binary data types | String attributes |
Logical data types | Boolean attributes |
Date and time data types | Date attributes |
Arrays | Array of strings, array of numbers, or array of booleans |
Object, variant, geography, geometry, and vector data types | String attributes |
For more information about Snowflake data types, see Snowflake: Summary of Data Types.
Events
In the default Tealium data collection order of operations, events from a Snowflake data source are processed before the Event received step and do not change the order of operations.
Snowflake data source events are sent to EventStream and AudienceStream in the same way as events from other data sources with the following important exceptions:
- Browser-specific attributes: Browser-specific attributes, such as user agent, are not populated.
- Enrichments: Enrichments on preloaded attributes in AudienceStream are not run, except for the
First visit
attribute. - Functions: Data transformation functions are not run.
- Single-page visits: Incoming events are exempt from the single-page visit/visitors criteria. Single-page visits and visitors from other data sources are not persisted in AudienceStream. For more information, see How are single-page visits processed in AudienceStream? (requires Tealium login).
- Visit length: A visit started by a Snowflake data source event lasts for 60 seconds.
- Visitor ID mapping: If you map an AudienceStream visitor ID attribute in your Snowflake data source configuration, the visitor ID is set directly to the value of the column you choose and no additional enrichment is needed.
Configuration
Query Modes
The Snowflake data source supports three query modes to let you control how data is imported from your Snowflake table or view:
Timestamp + Incrementing (Recommended)
Timestamp + Incrementing is the most reliable mode to ensure that all rows are imported as expected.
Tealium imports new or modified rows based on a timestamp column and an auto-increment column. In this mode, rows with a newer timestamp than the previous import and/or a larger auto-increment value than the last imported row are imported.
Additional modes
Timestamp
Tealium imports new or modified rows based on a timestamp column. In this mode, rows with a newer timestamp than the previous import are imported. Use this mode if your table has a timestamp column that gets set or updated on every update.
Timestamp is not as reliable as Timestamp + Incrementing because rows may be missed if there are duplicate timestamps in different batches of data, as shown in the example below.
Incrementing Tealium imports rows based on an auto-increment column. In this mode, rows with a larger auto-increment value than the last imported row are imported. Use this mode if you only have an auto-increment column and do not have a timestamp column. Incrementing is not as reliable as Timestamp + Incrementing because it cannot detect modifications or deletions of existing rows.
The Snowflake data source does not support bulk query modes.
Query mode example
The following example shows how batch processing of rows and query modes work together. In the following table, modification_time
is the timestamp column and customer_id
is the incrementing column.
customer_id |
modification_time |
customer_segment |
---|---|---|
1 | 01Apr 13:00 | A |
2 | 01Apr 13:00 | B |
… | … | … |
1000 | 01Apr 13:00 | D |
1001 | 01Apr 13:00 | E |
1002 | 02Apr 14:00 | A |
The Snowflake data source fetches data 1,000 rows at a time and marks the maximum value of the timestamp and/or incrementing column(s) from the batch of data.
- Using Timestamp + Incrementing mode: The data source fetches rows 1-1000. The next time the data source fetches the data, it will look for rows where either
modification_time
is01Apr 13:00
and thecustomer_id
is greater than1000
or
modification_time
is greater than01Apr 13:00
- Using Timestamp mode (
modification_time
in the example): The data source will fetch rows 1-1000 and mark the maximum timestamp of01Apr 13:00
. The next time the data source fetches the data, it will look for a timestamp greater than01Apr 13:00
. In this case, row 1001 would be skipped because it has the same timestamp value but was fetched in different batch of data. - Using Incrementing mode: The data source will fetch rows 1-1000 and mark the maximum auto-increment value of
1000
, but rows with new data and an updated timestamp column would not be processed. Only newly added rows that further increment the incrementing column (customer_id
in the example) would be processed.
SQL Query
In the Snowflake data source Query Configuration, select the columns you want to import into Tealium. To add additional conditions for processing, use the SQL WHERE
clause. This option adds a WHERE
statement to your query. WHERE
statements support basic SQL syntax.
The WHERE
clause does not support subqueries from multiple tables. To import data from multiple Snowflake tables, create a view in Snowflake and select the view in the data source configuration. For more information, see Snowflake: Overview of Views.
Column mapping
The column mapping configuration determines the event attributes that correspond to each column in the Snowflake table.
Column names are often different from the attribute names in the Customer Data Hub, so this mapping ensures that the data is imported properly. For example, a table might have a column named postalCode
, but the matching event attribute is named customer_zip
, so you need a mapping to associate them.
For information about mapping Snowflake data types to Tealium data types, see the Data Types section.
Visitor ID mapping
To ensure your imported data is stitched with other sources, such as web, mobile, or HTTP API, ensure that every row in the Snowflake table has a column with a unique visitor ID. You can then map the visitor ID column and corresponding event attribute to a visitor ID attribute (a unique attribute type for visitor identification in AudienceStream). The value in the mapped event attribute is assigned to the tealium_visitor_id
attribute and matched directly to any existing visitor profiles.
For more information about Visitor ID Mapping in AudienceStream, see Visitor Identification using Tealium Data Sources.
IP Addresses to allow
If your Snowflake account has strict rules about which systems it accepts requests from, add the Tealium IP addresses to your Snowflake allow list.
This page was last updated: November 14, 2024