You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Jarek Potiuk (Jira)" <ji...@apache.org> on 2020/01/19 22:52:00 UTC

[jira] [Updated] (AIRFLOW-6087) Snowflake Connector cannot run more than one sql from a sql file

     [ https://issues.apache.org/jira/browse/AIRFLOW-6087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jarek Potiuk updated AIRFLOW-6087:
----------------------------------
    Labels: gsoc gsoc2020 mentor  (was: )

> Snowflake Connector cannot run more than one sql from a sql file
> ----------------------------------------------------------------
>
>                 Key: AIRFLOW-6087
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-6087
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: contrib, operators
>    Affects Versions: 1.10.6
>            Reporter: Saad
>            Priority: Major
>              Labels: gsoc, gsoc2020, mentor
>
> I am getting an error when passing in a SQL file with multiple SQL statements to snowflake operator
> {code:java}
> snowflake.connector.errors.ProgrammingError: 000006 (0A000): 01908236-01a3-b2c4-0000-f36100052686: Multiple SQL statements in a single API call are not supported; use one API call per statement instead.
> {code}
> It only fails if you pass a file with multiple statements. A file with just one statement or list of statements to the operator works fine.
> After looking at the current snowflake operator implementation it seems like a list of SQL statements work because it executes one statement at a time. Whereas multiple statements in a SQL file fails because all of them are read as one continuous string.
>  
> h4. _*How can we fix this:*_
> There is an API call in Snowflake python connector that supports multiple SQL statements.
> [https://docs.snowflake.net/manuals/user-guide/python-connector-api.html#execute_string]
> This can be fixed by overriding the run function in Snowflake Hook to support multiple sql statements in a file.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)