MSCEWI2079

The required period type column was not found

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

Severity

Low

Description

This warning is shown because the Period column necessary to replicate the functionality of Normalize clause was not found.

Example code

Input code

SELECT NORMALIZE emp_id, duration2 FROM project;

Output code

/*** MSC-WARNING - MSCEWI2079 - THE REQUIRED PERIOD TYPE COLUMN WAS NOT FOUND ***/
WITH NormalizeCTE AS
(
  SELECT
    T1.*,
    SUM(GroupStartFlag)
    OVER (
    PARTITION BY
      emp_id, duration2
    ORDER BY
      PeriodColumn_begin
    ROWS UNBOUNDED PRECEDING) GroupID
  FROM
    (
      SELECT  
        emp_id,
        duration2,
        /*** MSC-WARNING - MSCEWI1020 - CUSTOM UDF 'PERIOD_BEGIN_UDF' INSERTED. ***/
        PUBLIC.PERIOD_BEGIN_UDF(PeriodColumn) PeriodColumn_begin,
        /*** MSC-WARNING - MSCEWI1020 - CUSTOM UDF 'PERIOD_END_UDF' INSERTED. ***/
        PUBLIC.PERIOD_END_UDF(PeriodColumn) PeriodColumn_end,
        (CASE
          WHEN PeriodColumn_begin <= LAG(PeriodColumn_end)
          OVER (
          PARTITION BY
            emp_id, duration2
          ORDER BY
            PeriodColumn_begin,
            PeriodColumn_end)
            THEN 0
          ELSE 1
        END) GroupStartFlag
      FROM  
        PUBLIC.project
    ) T1
)
SELECT
  emp_id,
  duration2,
  /*** MSC-WARNING - MSCEWI1020 - CUSTOM UDF 'PERIOD_UDF' INSERTED. ***/
  PUBLIC.PERIOD_UDF(MIN(PeriodColumn_begin), MAX(PeriodColumn_end))
FROM
  NormalizeCTE
GROUP BY
  emp_id,
  duration2,
  GroupID;

Recommendations

  • To fix this warning manually you just need to find which was the first period column and remove all its references except where is defined, and then replace PeriodColumn with the column found.

  • If you need more support, you can email us at snowconvert-support@snowflake.com

Last updated