MSC-BQ0016
Session variable assignment of complex datatype is not supported in Snowflake
Last updated
Session variable assignment of complex datatype is not supported in Snowflake
Last updated
This is a deprecated version of the SnowConvert documentation, please visit the official site .
Medium
In BigQuery, declaring a variable at script level allows it to be used in the entire script, to replicate this behavior in Snowflake are used.
However, declaring variables of datatypes that are complex like ARRAY, GEOGRAPHY, STRUCT or JSON will fail in Snowflake when trying to set the value to the SQL variable. When SnowConvert detects one of such cases then this is EWI will be added to the SQL variable declaration.
Variables of these types can be declared without problems inside block statements and other procedural statements, this EWI applies only for variables declared at script level.
If the uses of the variable are limited to a single scope or its value is never modified, consider declaring the variable locally in the scopes that use it, that will solve the issue.
If you need more support, you can email us at