This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.
Severity
Low
Description
This warning appears when a CAST function specifies a specific output format and is not supported by Snowflake.
Code Example
Input:
CREATETABLESAMPLE_TABLE( VARCHAR_TYPE VARCHAR, CHAR_TYPE CHAR(11), INTEGER_TYPE INTEGER, DATE_TYPE DATE, TIMESTAMP_TYPE TIMESTAMP, TIME_TYPE TIME, PERIOD_TYPE PERIOD(DATE));REPLACE VIEW SAMPLE_VIEW ASSELECTCAST(VARCHAR_TYPE ASFLOAT FORMAT 'ZZZ.ZZZZZ'),CAST('01:02.030405'ASTIME(1) WITH TIME ZONE FORMAT 'MI:SS.S(6)'),CAST('01-12-2020'ASDATE FORMAT 'dd-mm-yyyy')FROM SAMPLE_TABLE;
Output:
CREATETABLEPUBLIC.SAMPLE_TABLE( VARCHAR_TYPE VARCHAR, CHAR_TYPE CHAR(11), INTEGER_TYPE INTEGER, DATE_TYPE DATE, TIMESTAMP_TYPE TIMESTAMP, TIME_TYPE TIME, PERIOD_TYPE VARCHAR(24) COMMENT 'PERIOD(DATE)' /*** MSC-WARNING - MSCEWI1036 - PERIOD DATA TYPE "PERIOD(DATE)" CONVERTED TO VARCHAR ***/
);CREATE OR REPLACEVIEWPUBLIC.SAMPLE_VIEWASSELECTTO_NUMBER(VARCHAR_TYPE, '999.00000', 38, 10) /*** MSC-WARNING - MSCEWI2025 - OUTPUT FORMAT 'ZZZ.ZZZZZ' NOT SUPPORTED. ***/,
TO_TIME('01:02.030405', 'MI:SS.FF6') /*** MSC-WARNING - MSCEWI2025 - OUTPUT FORMAT 'MI:SS.S(6)' NOT SUPPORTED. ***/,TO_DATE('01-12-2020', 'DD-MM-YYYY') /*** MSC-WARNING - MSCEWI2025 - OUTPUT FORMAT 'dd-mm-yyyy' NOT SUPPORTED. ***/FROM PUBLIC.SAMPLE_TABLE;
Recommendations
Take a look if the output code has functional equivalence with the original code.