Expand On Clause
Translation reference to convert Teradata Expand On functionality to Snowflake
Last updated
Translation reference to convert Teradata Expand On functionality to Snowflake
Last updated
The Expand On clause expands a column having a period data type, creating a regular time series of rows based on the period value in the input row. For more information about Expand On clause, see the .
Suppose you want to expand the period column by seconds, for this Expand On clause has anchor period expansion and interval literal expansion.
Snowflake doesn't support Expand On clause. To reproduce the same results and functionality, the Teradata SQL code will be contained in a CTE block, with an EXPAND_ON_UDF and TABLE function, using FLATTEN function to return multiple rows, ROW_COUNT_UDF and DIFF_TTIME_PERIOD_UDF to indicate how many rows are needed and returning VALUE to help the EXPAND_ON_UDF to calculate the different regular time series. This CTE block returns the same expand columns alias as in the Expand On clause, so the result can be used in any usage of period datatype.
The Expand On clause can use interval literal expansion, for this case, SnowConvert will add an error that this translation is planned.
: Pending Functional Equivalence Review.
: Snowflake does not support the period datatype, all periods are handled as varchar instead.