Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Version published after converting to the new editor

On this Page

Table of Contents
maxLevel2
excludeOlder Versions|Additional Resources|Related Links|Related Information

...

Snap type:

Write


Description:

This Snap executes a Snowflake SQL Insert statement with given values. Document keys will be used as the columns to insert into, and their values will be the values inserted. Missing columns from the document will have null values inserted into them. 


Expected upstream Snaps:  The data to be written to the table can be defined by providing values upstream. The document generator Snaps JSON Generator can be used upstream.
 
Expected downstream Snaps: The Snap will output one document for every record written, hence any document processing Snap can be used downstream. 

Prerequisites:

Insert excerpt
Snowflake - Bulk Load
Snowflake - Bulk Load
nopaneltrue

Security Prerequisites: You should have the following permissions in your Snowflake account to execute this Snap: 

  • Usage (DB and Schema): Privilege to use database, role, and schema.
  • Create table: Privilege to create a new table or insert data into an existing table.

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

This Snap uses the INSERT command internally. It enables updating a table by inserting one or more rows into the table.

Info

UseSnowflake - Bulk Load Snap to do efficient bulk load of records instead of using the Snowflake - Insert Snap. The Snowflake Bulk Snaps use the Snowflake’s Bulk API thus improving the performance.


Support and limitations:
  • Works in Ultra Task Pipelines if Batch size is set to 1 in the Snowflake account.
  • Snowflake does not support batch insert. As a workaround, use the Snowflake - Bulk Load Snap to insert records in batches.
    Though the Snowflake Insert Snap sends requests in batches, Snowflake does not support executing multiple SQL statements in a single API call. So, even if batching is enabled in a Snowflake Insert Snap, Snowflake will execute one SQL statement at a time.
Known Issues:Because of performance issues, all Snowflake Snaps now ignore the Cancel queued queries when pipeline is stopped or if it fails option for Manage Queued Queries, even when selected. Snaps behave as though the default Continue to execute queued queries when the Pipeline is stopped or if it fails option were selected.

Image Modified

Account: 

This Snap uses account references created on the Accounts page of  SnapLogic Manager to handle access to this endpoint. See Configuring Snowflake Accounts for information on setting up this type of account.


Views:


Input

This Snap has one document input view by default. 

A second view can be added for table metadata as a document so that the table is created in Snowflake with a similar schema as the source table. This schema is usually from the second output of a database Select Snap. If the schema is from a different database, there is no guarantee that all the data types would be properly handled.

Output

This Snap has at most one output view.

Error

This Snap has at most one error view and produces zero or more documents in the view.



Settings

Label*


Specify the name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline.

Schema name



Specify the database schema name. In case it is not defined, then the suggestion for the Table Name will retrieve all table names of all schemas. The property is suggestible and will retrieve available database schemas during suggest values.

Note

The values can be passed using the pipeline parameters but not the upstream parameter.

Default value:  [None]


Table name*

Specify the name of the table to execute insert-on.

Note

The values can be passed using the pipeline parameters but not the upstream parameter.


Note
A table name with special characters is not supported.

Default value:  [None]


Create table if not present


Multiexcerpt include macro
nameME_Create_Table_Automatically_2_Inputs
pageRedshift - Bulk Load

Default value:  Not selected

Preserve case sensitivity
Insert excerpt
MySQL - Insert
MySQL - Insert
nopaneltrue
Number of retries

Specify the maximum number of attempts to be made to receive a response. The request is terminated if the attempts do not result in a response.

Default value: 0
Example: 3

Multiexcerpt include macro
nameretries
pageFile Reader

Retry interval (seconds)

Specify the time interval between two successive retry requests. A retry happens only when the previous attempt resulted in an exception. 

Default value: 1
Example:  10

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.

Note

If you select Cancel queued queries when the pipeline is stopped or if it fails, then the read queries under execution are canceled, whereas the write queries under execution are not canceled. Snowflake internally determines which queries are safe to be canceled and cancels those queries.

Default value: Continue to execute queued queries when the pipeline is stopped or if it fails

Multiexcerpt include macro
nameSnap Execution
pageSOAP Execute

Multiexcerpt include macro
nameExecution_Detail_Write
pageSOAP Execute

...