MSCEWI4014

With partitions clause in a truncate statement is not supported

Severity

Medium

Description

This EWI is added when SnowConvert finds a TRUNCATE TABLE statement that contains a WITH PARTITIONS clause.

WITH PARTITIONS is not supported in Snowflake, and the behavior of TRUNCATE TABLE without it is not the intended behavior that the original code had. For this reason, the entire TRUNCATE TABLE statement is commented out.

Code Example

Input Code:

TRUNCATE TABLE TABLE2 WITH ( PARTITIONS ($PARTITION.SomeNumberRange(@SomeNumber)) );

Output Code:

/*** MSC-ERROR - MSCEWI4014 - WITH PARTITIONS CLAUSE IN TRUNCATE STATEMENT IS NOT SUPPORTED IN SNOWFLAKE. ***/
/*TRUNCATE TABLE TABLE2 WITH ( PARTITIONS ($PARTITION.SomeNumberRange(@SomeNumber)) )*/

Recommendations