MSCEWI2002

Interval type not supported.

Severity

High

Description

When the selector of a column in a SQL statement is type INTERVAL, the EWI will be added and a Stub function will be created too. This is a type that is not supported in SnowFlake and therefore implies pending work, after SnowConvert finishes.

Code Example

Input Code:

SELECT
CAST('07:00' AS INTERVAL HOUR(2) TO MINUTE),
CAST('08:00' AS INTERVAL HOUR(2) TO MINUTE) As Test_Interval,
FROM DATASHIP.TABLE2;

Output Code:

SELECT
/*** MSC-ERROR - MSCEWI2002 - INTERVAL TYPE NOT SUPPORTED IN SNOWFLAKE ***/
PUBLIC.Interval_UDF(INTERVAL '07 hour, 00 min'),
/*** MSC-ERROR - MSCEWI2002 - INTERVAL TYPE NOT SUPPORTED IN SNOWFLAKE ***/
PUBLIC.Interval_UDF(INTERVAL '08 hour, 00 min') As Test_Interval,
FROM DATASHIP.PUBLIC.TABLE2;

Also, the function Interval_UDF will be created in the folder "UDF Helpers" in the sql file STUBS_UDF.

CREATE OR REPLACE FUNCTION PUBLIC.Interval_UDF (INPUT VARCHAR)
RETURNS STRING
LANGUAGE JAVASCRIPT
AS
$$
return INPUT.concat(' NOT SUPPORTED');
$$;

Recommendations

It is recommended to fill up the code of the Interval_UDF with the appropriate coding according to the custom requirements.