TD_UNPIVOT
Translation specification for the transformation of TD_UNPIVOT into an equivalent query in Snowflake
Some parts in the output code are omitted for clarity reasons.
Description
TD_UNPIVOT
in Teradata can unpivot multiple columns at once, while Snowflake UNPIVOT
can only unpivot a single column**.** The unpivot functionality is used to transform columns of the specified table into rows. For more information see TD_UNPIVOT.
The following transformation is able to generate a SQL query in Snowflake that unpivots multiple columns at the same time, the same way it works in Teradata.
Sample Source Patterns
Setup data title
Teradata
Snowflake
TD_UNPIVOT transformation
Teradata
Snowflake
Known Issues
TD_UNPIVOT with INCLUDE_NULLS clause set to YES is not supported
Snowflake UNPIVOT function used in the transformation will ignore null values always, and the user will be warned that the INCLUDE_NULLS clause is not supported when it is set to YES.
Table information is required to correctly transform the function
SnowConvert needs the name of the columns that are being used in the TD_UNPIVOT function; if the user does not include the columns list in the query_expression of the function but provides the name of the table being unpivoted, then it will try to retrieve the column names from the table definition. If the names can not be found then the user will be warned that the resulting query might be losing columns in the result.
Related EWIs
SSC-EWI-TD0061: TD_UNPIVOT transformation requires column information that could not be found, columns missing in result.
Last updated