SnowflakeSqlApiOperatorAsync

Astronomer Providers

Implemented Async Snowflake SQL API Operator to support multiple SQL statements sequentially, which is the behavior of the SnowflakeOperator, the Snowflake SQL API allows submitting multiple SQL statements in a single request. In combination with aiohttp, make post request to submit SQL statements for execution, poll to check the status of the execution of a statement. Fetch query results concurrently. This Operator currently uses key pair authentication, so you need tp provide private key raw content or private key file path in the snowflake connection along with other details

Access Instructions

Install the Astronomer Providers provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

snowflake_conn_idReference to Snowflake connection id
sqlthe sql code to be executed. (templated)
autocommitif True, each command is automatically committed. (default value: True)
parameters(optional) the parameters to render the SQL query with.
warehousename of warehouse (will overwrite any warehouse defined in the connection’s extra JSON)
databasename of database (will overwrite database defined in connection)
schemaname of schema (will overwrite schema defined in connection)
rolename of role (will overwrite any role defined in connection’s extra JSON)
authenticatorauthenticator for Snowflake. ‘snowflake’ (default) to use the internal Snowflake authenticator ‘externalbrowser’ to authenticate using your web browser and Okta, ADFS or any other SAML 2.0-compliant identify provider (IdP) that has been defined for your account ‘https://.okta.com’ to authenticate through native Okta.
session_parametersYou can set session-level parameters at the time you connect to Snowflake
poll_intervalthe interval in seconds to poll the query
statement_countNumber of SQL statement to be executed
token_life_timelifetime of the JWT Token
token_renewal_deltaRenewal time of the JWT Token
bindings(Optional) Values of bind variables in the SQL statement. When executing the statement, Snowflake replaces placeholders (? and :name) in the statement with these specified values.

Documentation

Implemented Async Snowflake SQL API Operator to support multiple SQL statements sequentially, which is the behavior of the SnowflakeOperator, the Snowflake SQL API allows submitting multiple SQL statements in a single request. In combination with aiohttp, make post request to submit SQL statements for execution, poll to check the status of the execution of a statement. Fetch query results concurrently. This Operator currently uses key pair authentication, so you need tp provide private key raw content or private key file path in the snowflake connection along with other details

param snowflake_conn_id

Reference to Snowflake connection id

param sql

the sql code to be executed. (templated)

param autocommit

if True, each command is automatically committed. (default value: True)

param parameters

(optional) the parameters to render the SQL query with.

param warehouse

name of warehouse (will overwrite any warehouse defined in the connection’s extra JSON)

param database

name of database (will overwrite database defined in connection)

param schema

name of schema (will overwrite schema defined in connection)

param role

name of role (will overwrite any role defined in connection’s extra JSON)

param authenticator

authenticator for Snowflake. ‘snowflake’ (default) to use the internal Snowflake authenticator ‘externalbrowser’ to authenticate using your web browser and Okta, ADFS or any other SAML 2.0-compliant identify provider (IdP) that has been defined for your account ‘https://<your_okta_account_name>.okta.com’ to authenticate through native Okta.

param session_parameters

You can set session-level parameters at the time you connect to Snowflake

param poll_interval

the interval in seconds to poll the query

param statement_count

Number of SQL statement to be executed

param token_life_time

lifetime of the JWT Token

param token_renewal_delta

Renewal time of the JWT Token

param bindings

(Optional) Values of bind variables in the SQL statement. When executing the statement, Snowflake replaces placeholders (? and :name) in the statement with these specified values.

Was this page helpful?