SSC-EWI-TD0025

Output format not supported.

Severity

Low

Description

This EWI appears when a CAST function specifies an output format not supported by Snowflake scripting.

Code Example

Teradata:

IN -> Teradata_01.sql
CREATE TABLE SAMPLE_TABLE
(
    VARCHAR_TYPE VARCHAR
);

REPLACE VIEW SAMPLE_VIEW 
AS
SELECT
CAST(VARCHAR_TYPE AS FLOAT FORMAT 'ZZZ.ZZZZZ'),
CAST('01:02.030405' AS TIME(1) WITH TIME ZONE FORMAT 'MI:SS.S(6)'),
CAST('01-12-2020' AS DATE FORMAT 'dd-mm-yyyy')
FROM SAMPLE_TABLE;

Snowflake Scripting:

OUT -> Teradata_01.sql
CREATE OR REPLACE TABLE SAMPLE_TABLE (
    VARCHAR_TYPE VARCHAR
)
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"teradata"}}'
;

CREATE OR REPLACE VIEW SAMPLE_VIEW
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"teradata"}}'
AS
SELECT
    TO_NUMBER(VARCHAR_TYPE, '999.00000', 38, 10) !!!RESOLVE EWI!!! /*** SSC-EWI-TD0025 - OUTPUT FORMAT 'ZZZ.ZZZZZ' NOT SUPPORTED. ***/!!!,
    TO_TIME('01:02.030405', 'MI:SS.FF6') !!!RESOLVE EWI!!! /*** SSC-EWI-TD0025 - OUTPUT FORMAT 'MI:SS.S(6)' NOT SUPPORTED. ***/!!!,
    TO_DATE('01-12-2020', 'DD-MM-YYYY') !!!RESOLVE EWI!!! /*** SSC-EWI-TD0025 - OUTPUT FORMAT 'dd-mm-yyyy' NOT SUPPORTED. ***/!!!
   FROM
    SAMPLE_TABLE;

Recommendations

Last updated