On this Page
Table of Contents | ||||
---|---|---|---|---|
|
Overview
The Snowflake Multi Execute Snap is a Write type Snap that enables you to execute multiple queries as a single atomic unit. This means that. if any query fails in execution, the changes are rolled back. This Snap supports executing all Snowflake queries.
Expected Input and Output
While the Snap does not require an input document, it supports document input and generates document outputs. Snaps that accept or generate documents can be used upstream or downstream of the Snap.
Expected upstream Snaps: The dynamic variables used in the execute query can be defined by providing values upstream. Document-generating Snaps such as JSON Generator can be used in upstream.
Expected downstream Snaps: The Snap will output one document for every record retrieved, hence any document processing Snap can be used downstream.
Prerequisites
- Read and write access to the Snowflake instance.
Insert excerpt https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438549/Snowflake+-+Bulk+Load https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438549/Snowflake+-+Bulk+Load nopanel true Security Prerequisites: You should have the following permissions in your Snowflake account to execute this Snap:
Info icon false Usage (DB and Schema): Privilege to use database, role, and schema.
Create table: Privilege to create table on database. role and schema.
The following commands enable minimum privileges in the Snowflake Console:
Code Block |
---|
grant usage on database <database_name> to role <role_name>; grant usage on schema <database_name>.<schema_name>; grant "CREATE TABLE" on database <database_name> to role <role_name>; grant "CREATE TABLE" on schema <database_name>.<schema_name>; |
For more information on Snowflake privileges, refer to Access Control Privileges.
Internal SQL Commands
The permissions to grant for using commands depends on the queries you provide in this Snap.
Configuring Accounts
This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Snowflake Account for information on setting up this type of account.
Configuring Views
Input | This Snap has at most one document input view. |
---|---|
Output | This Snap has at most one document output view. |
Error | This Snap has at most one document error view. |
Troubleshooting
None.
Limitations and Known Issues
- Select statement and transactional statements such as Begin, Commit, and Rollback are not supported.
- Changes made to the database using Data Definition Language (DDL) queries are not rolled back if the Snap fails, this is since DDL statements are always auto-committed by default.
If there is one DDL query among other queries that the Snap is executing, then the rollback is only for the changes made by the queries executed after the DDL query. Ensure that the Disable session auto-commit property is selected when using DDL queries. See Snowflake Auto-commit for details.
This is not applicable to Data Modification Language (DML) queries. The Snap may break existing Pipelines if the JDBC Driver is updated to a newer version.
Note title Snowflake Execute and Multi-Execute Snaps may break existing Pipelines if the JDBC Driver is updated to a newer version. With the updated JDBC driver (version 3.12.3), the Snowflake Execute and Multi-Execute Snaps' output displays a Status of "-1" instead of "0" without the Message field upon successfully executing DDL statements. If your Pipelines use these Snaps and downstream Snaps use the Status field's value from these, you must modify the downstream Snaps to proceed on a status value of -1 instead of 0.
This change in the Snap behavior follows from the change introduced in the Snowflake JDBC driver in version 3.8.1:
"Statement.getUpdateCount() and PreparedStatement.getUpdateCount() return the number of rows updated by DML statements. For all other types of statements, including queries, they return -1."
Modes
- Ultra Pipelines: Does not work in Ultra Pipelines.
Snap Settings
Label | Required. The name for the Snap. Modify this to be more specific, especially if there are more than one of the same Snap in the pipeline. | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SQL Statements | Required. Provide the queries to be executed by the Snap. End each query with a semi-colon, except the last query. To add another query, click the + to add a row and there add the query. Default value: None
| |||||||||||||||||||||||||
Session auto-commit | Select this to enable the session's auto-commit. This is useful when using DDL queries since the changes made by such queries cannot be rolled back if the Snap/pipeline fails. If deselected, changes made by DML queries can be rolled back or changes made by DML queries after a DDL queries can be rolled back. Default value: Selected | |||||||||||||||||||||||||
Use Result Query | This property enables displaying the result set in output view.
| |||||||||||||||||||||||||
Manage Queued Queries | Select this property to decide whether the Snap should continue or cancel the execution of the queued Snowflake Execute SQL queries when you stop the pipeline.
Default value: Continue to execute queued queries when pipeline is stopped or if it fails | |||||||||||||||||||||||||
|
|
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|