Snowflake File Uploader
The Snowflake File Uploader target writes whole files to an internal Snowflake stage. Use this target with a whole file source and the Snowflake executor. For details, see Snowflake File Uploader and executor flows in the Snowflake executor documentation.
You can use the Snowflake File Uploader target with any accessible Snowflake database, including those hosted on AWS, Microsoft Azure, and private Snowflake installations. For information about supported versions, see Supported systems and versions.
When you configure the Snowflake File Uploader target, you specify Snowflake connection information, such as the Snowflake region and user account. You can optionally specify an organization name to use. You can also use a connection to configure the target.
You define staging information, such as the database, schema, and name of the internal Snowflake stage to write to, as well as the number of threads to use. You can configure the target to create the internal Snowflake stage, then specify the file format for the stage and related properties.
Before you use the Snowflake File Uploader target, you must complete several prerequisite tasks.
You can configure the target to generate events for another event stream. For more information about dataflow triggers and the event framework, see Dataflow triggers overview.
Prerequisites
- Optionally, create an internal Snowflake stage.
You can skip this step if you want to stage data on a Snowflake internal user stage or if you want the target to create the stage.
- Assign required privileges.
Create an internal Snowflake stage (optional)
The Snowflake File Uploader target writes whole files to an internal Snowflake stage. You can either create the internal Snowflake stage before using the target in a flow, or you can have the target create the stage.
You can use an internal named, table, or user stage. User stages are created by default for each user. For steps on how to create a named or table stage, see CREATE STAGE in the Snowflake SQL command reference documentation.
You can use the default Snowflake configuration for all stages.
For more information about Snowflake stages, see the Snowflake documentation.
Assign required privileges
- Read
- Write
- Create Stage
- Create File Format
The user does not need Create File Format when you use a custom Snowflake file format as the data format for the table.
Implementation notes
The Snowflake File Uploader target was designed to be used with a whole file source and the Snowflake executor. For details on using these stages in a flow, see Snowflake File Uploader and executor flows in the Snowflake executor documentation.
Define a role
The Snowflake File Uploader target requires a Snowflake role that grants all privileges needed to load data using the configured load method. Each load method requires a different set of privileges.
Before configuring the target, ensure that you have granted the required privileges to a Snowflake role, as explained in Assign required privileges.
- Assign the custom role as the default role
- In Snowflake, assign the custom role as the default role for the Snowflake user account specified in the stage. A Snowflake user account is associated with a single default role.
- Override the default role with the custom role
- In the stage, use the Role property to specify the name of the custom role. The custom role overrides the role assigned to the Snowflake user account specified in the stage.
Event generation
The Snowflake File Uploader target can generate events that you can use in an event stream. When you enable event generation, the target generates event records each time the target completes streaming a whole file.
- With the Snowflake executor to load files to Snowflake tables.
For a description, see Snowflake File Uploader and executor flows.
- With the Email executor to send a custom email
after receiving an event.
For an example, see Sending email during flow processing.
- With a target to store event information.
For an example, see Preserving an audit trail of events.
For more information about dataflow triggers and the event framework, see Dataflow triggers overview.
Event records
| Record Header Attribute | Description |
|---|---|
| sdc.event.type | Event type. Uses the following type:
|
| sdc.event.version | Integer that indicates the version of the event record type. |
| sdc.event.creation_timestamp | Epoch timestamp when the stage created the event. |
- File closure
- The target generates a file closure event record when it closes an output file.
Configuring a Snowflake File Uploader target
About this task
Configure a Snowflake File Uploader target to load whole files to an internal Snowflake stage. Use this target with a whole file source and the Snowflake executor. For details, see Snowflake File Uploader and executor flows in the Snowflake executor documentation.
Before you use the target in a flow, complete the prerequisite tasks.