MSCEWI2078

The Expand On clause functionality is transformed into a CTE block

This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.

Severity

Low

Description

SnowConvert indicates that the Expand On clause functionality transforms to a CTE block.

Example code

Input code

SELECT BEGIN(bg) FROM table1 EXPAND ON pd AS bg BY ANCHOR ANCHOR_SECOND;

Output code

WITH ExpandOnCTE AS
 (
  SELECT
  PUBLIC.EXPAND_ON_UDF('ANCHOR_SECOND', VALUE, pd) /*** MSC-WARNING - MSCEWI1020 - CUSTOM UDF 'EXPAND_ON_UDF' INSERTED. ***/ bg
  FROM
  PUBLIC.table1,
  TABLE(FLATTEN(PUBLIC.ROW_COUNT_UDF(PUBLIC.DIFFTTIME_PERIOD_UDF('ANCHOR_SECOND', pd) /*** MSC-WARNING - MSCEWI1020 - CUSTOM UDF 'DIFFTTIME_PERIOD_UDF' INSERTED. ***/) /*** MSC-WARNING - MSCEWI1020 - CUSTOM UDF 'ROW_COUNT_UDF' INSERTED. ***/))
)
SELECT
id,
PUBLIC.PERIOD_BEGIN_UDF(bg) /*** MSC-WARNING - MSCEWI1020 - CUSTOM UDF 'PERIOD_BEGIN_UDF' INSERTED. ***/ /*** MSC-WARNING - MSCEWI2053 - SNOWFLAKE DOES NOT SUPPORT THE PERIOD DATATYPE, ALL PERIODS ARE HANDLED AS VARCHAR INSTEAD ***/
FROM
PUBLIC.table1,
ExpandOnCTE
-- ** MSC-WARNING - MSCEWI2078 - THE EXPAND ON CLAUSE FUNCTIONALITY IS TRANSFORMED INTO A CTE BLOCK **
--              EXPAND ON pd AS bg BY ANCHOR ANCHOR_SECOND
 ;

Recommendations

Last updated