MSCEWI4074

Cast result may be different from TRY_CAST/TRY_CONVERT function due to missing dependencies

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

Severity

Low

Description

This EWI is added in the transformation of TRY_CAST and TRY_CONVERT function. The exact result of these functions may change in Snowflake due to missing dependencies (SnowConvert couldn't resolve some data types). This could be because the dependency was not in the source code.

Input Code:

SELECT TRY_CONVERT( INT, col1) FROM TABLE1;

SELECT TRY_CAST(COL1 AS FLOAT) FROM TABLE1

Output Code

SELECT
CAST(col1 AS INT) /*** MSC-WARNING - MSCEWI4027 - FUNCTION TRY_CONVERT TRANSFORMED TO CAST ***/ 
/*** MSC-WARNING - MSCEWI4074 - CAST RESULT MAY BE DIFFERENT FROM TRY_CONVERT FUNCTION DUE TO MISSING DEPENDENCIES ***/
FROM
TABLE1;

SELECT
CAST(COL1 AS FLOAT) /*** MSC-WARNING - MSCEWI4027 - FUNCTION TRY_CAST TRANSFORMED TO CAST ***/ 
/*** MSC-WARNING - MSCEWI4074 - CAST RESULT MAY BE DIFFERENT FROM TRY_CAST FUNCTION DUE TO MISSING DEPENDENCIES ***/
FROM
TABLE1;

Recommendation

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

Last updated