Code Conversion - Redshift Functional Differences¶
SSC-FDM-RS0001¶
Data storage option is not supported in Snowflake. Data distribution is automatically handled by Snowflake.
Description¶
In Snowflake, it is not necessary to explicitly define SORTKEY and DISTSTYLE when migrating from Redshift because Snowflake’s architecture inherently manages data distribution and optimization. Snowflake automatically handles data partitioning and indexing, optimizing query performance without requiring manual configuration of these parameters.
Code Example¶
Input Code:¶
Redshift¶
Generated Code:¶
Snowflake¶
Best Practices¶
- It is advisable to assess the use of
CLUSTER BYin Snowflake during migration from Redshift, as it may improve query performance by optimizing data locality for frequently queried columns. - If you need more support, you can email us at aim-support@snowflake.com
SSC-FDM-RS0002¶
The performance of CLUSTER BY in Snowflake may vary compared to the performance of SORTKEY in Redshift.
Description¶
The SORTKEY (excluding SORTKEY AUTO) in Amazon Redshift are analogous to CLUSTER BY in Snowflake. However, performance implications may vary due to architectural differences between Redshift and Snowflake.
SORTKEYimproves performance by maintaining data in a sorted order based on specified columns. This is particularly beneficial for range queries and ordering operations.CLUSTER BYin Snowflake organizes data into blocks based on designated columns, aiding in filtering and aggregation tasks. However, it is less stringent about ordering compared toSORTKEY.
Understanding these mechanisms is crucial for optimizing performance in each respective platform.
Code Example¶
Input Code:¶
Redshift¶
Generated Code:¶
Snowflake¶
Best Practices¶
- Benchmark after migration: Run representative queries on both platforms to compare performance, as
CLUSTER BYuses micro-partitioning rather than physical sort order. - Consider automatic clustering: For large tables with frequent queries on specific columns, enable automatic clustering in Snowflake.
- If you need more support, you can email us at aim-support@snowflake.com
SSC-FDM-RS0003¶
Pending translation for Redshift foreign key constraints.
Description¶
Pending translation for Redshift foreign key constraints. Snowflake supports foreign key constraints, but they are not enforced and serve only as referential integrity metadata. This is a tool limitation, not a Snowflake platform limitation.
Code Example¶
Input Code:¶
Redshift¶
Generated Code:¶
Snowflake¶
Best Practices¶
- You can manually alter tables with Foreign Keys and add them.
- If you need more support, you can email us at aim-support@snowflake.com
SSC-FDM-RS0004¶
It is possible that the date is wrong and Snowflake does not accept wrong dates
Description¶
In Snowflake, using TO_DATE with an invalid date string (like ’20010631’) results in an error because it enforces strict validation, rejecting any non-existent dates. In contrast, Redshift’s TO_DATE can adjust such invalid dates to the nearest valid date (e.g., rolling June 31 to July 1) if the is_strict parameter is set to false. This difference highlights how Snowflake prioritizes data integrity by not automatically correcting invalid dates, while Redshift allows for more flexibility in date handling.
Code Example¶
Input Code:¶
Redshift¶
Generated Code:¶
Snowflake¶
Best Practices¶
- Check that the date is valid in the TRY_TO_DATE().
- If you need more support, you can email us at aim-support@snowflake.com
SSC-FDM-RS0005¶
Redshift MERGE rejects duplicate source rows. Snowflake allows them, which may produce different results.
Description¶
In Redshift, the MERGE statement throws an error when the source table contains duplicate rows matching the join condition. Snowflake allows MERGE to execute with duplicate source rows, which may produce non-deterministic results when multiple source rows match the same target row.
Code Example¶
Input Code:¶
Redshift¶
Generated Code:¶
Snowflake¶
Best Practices¶
- Deduplicate source data: Add a
QUALIFY ROW_NUMBER() OVER (PARTITION BY join_key ORDER BY ...) = 1to the source subquery to ensure each target row matches at most one source row. - Validate results: After migration, compare
MERGEoutput row counts between Redshift and Snowflake to detect non-deterministic behavior. - If you need more support, you can email us at aim-support@snowflake.com
SSC-FDM-RS0006¶
Called procedure contains usages of COMMIT/ROLLBACK. Modifying the current transaction in child scopes is not supported in Snowflake.
Description¶
In Redshift, it is allowed to use the statements COMMIT and ROLLBACK inside a procedure to make permanent or discard the changes on a transaction that was opened on an outer scope.
Snowflake works with the concept of scoped transactions, which treats each procedure call as a separate transaction, this limits the effects of the COMMIT and ROLLBACK statements to the scope of the procedure they are declared in.
The aforementioned functional difference will be warned with this FDM when calls to a procedure with COMMIT or ROLLBACK are detected by SnowConvert.
Code Example¶
Input Code:¶
Redshift¶
Generated Code:¶
Snowflake¶
Best Practices¶
- Refactor transaction control: Move
COMMITandROLLBACKstatements into the outermost procedure or use scoped transactions where supported. - Use caller’s rights: Ensure the calling procedure manages the transaction boundary, as Snowflake’s scoped transactions isolate child procedure changes.
- If you need more support, you can email us at aim-support@snowflake.com
SSC-FDM-RS0007¶
DDL statements perform an automatic COMMIT in Snowflake. ROLLBACK will not undo DDL-committed changes.
Description¶
In Snowflake, DDL statements perform an automatic commit after their execution, making permanent all the changes in the current transaction, meaning they can not be discarded by a ROLLBACK.
When a ROLLBACK statement is found in a procedure that also contains a DDL statement, this FDM will be generated to inform about the DDL autocommit behavior.
Code Example¶
Input Code:¶
Redshift¶
Generated Code:¶
Snowflake¶
Best Practices¶
- Separate DDL from DML transactions: Move DDL statements outside the transaction block, or execute them before
BEGIN TRANSACTIONto avoid implicit commits affecting DML operations. - Use conditional logic: If DDL creation is conditional, check for object existence with
IF NOT EXISTSto avoid unnecessary autocommits. - If you need more support, you can email us at aim-support@snowflake.com
SSC-FDM-RS0008¶
Snowflake uses autocommit by default. The NONATOMIC option is not supported in Snowflake.
Description¶
In Redshift, the NONATOMIC option on CREATE PROCEDURE allows individual statements within the procedure to commit independently. In Snowflake, autocommit is the default behavior — each statement is automatically committed unless wrapped in an explicit BEGIN TRANSACTION block. The NONATOMIC keyword is removed during migration because Snowflake’s autocommit provides equivalent semantics.
Code Example¶
Input Code:¶
Redshift¶
Generated Code:¶
Snowflake¶
Best Practices¶
- Verify transaction behavior: If the original Redshift procedure relied on
NONATOMICfor partial commits, test the migrated Snowflake procedure to confirm that autocommit provides the expected semantics. - Add explicit transactions where needed: If you need atomic (all-or-nothing) behavior for a group of statements in Snowflake, wrap them in
BEGIN TRANSACTION…COMMIT. - If you need more support, you can email us at aim-support@snowflake.com
SSC-FDM-RS0009¶
DATEADD over a leap day with a non-constant year may differ from Redshift
Description¶
When the year quantity is not a compile-time constant, SnowConvert AI cannot determine whether adding it to February 29 produces a leap-year target. The generated DATEADD is left unchanged and this FDM is added because Redshift and Snowflake can resolve non-leap target years differently.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
- Test leap-day inputs with non-constant year quantities and define the required behavior for non-leap target years.
- Add explicit date-adjustment logic when Snowflake’s result differs from the source requirement.
- If you need more support, you can email us at aim-support@snowflake.com
SSC-FDM-RS0010¶
The Redshift S3 credentials cannot be translated.
Description¶
SnowConvert AI reports SSC-FDM-RS0010 while converting Redshift code because the Snowflake result is not the same as the source. The Redshift s3 credentials cannot be translated. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0010 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0011¶
PARALLEL OFF was translated to SINGLE = TRUE.
Description¶
SnowConvert AI reports SSC-FDM-RS0011 while converting Redshift code because the Snowflake result is not the same as the source. Redshift parallel off was translated to single = true. Snowflake writes one file and fails when it exceeds the maximum file size instead of splitting it as Redshift does. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0011 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0012¶
Partition columns stay in the unloaded data.
Description¶
SnowConvert AI reports SSC-FDM-RS0012 while converting Redshift code because the Snowflake result is not the same as the source. Redshift omits the partition columns from the unloaded files unless ‘include’ is used. The generated Snowflake partition by expression always keeps them in the projected data. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0012 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0013¶
CASCADE was not carried over to the dynamic table refresh
Description¶
SnowConvert AI reports SSC-FDM-RS0013 while converting Redshift code because the Snowflake result is not the same as the source. Cascade was not carried over to the dynamic table refresh. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0013 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0014¶
The RESTRICT keyword was removed; it is applied by default in Snowflake
Description¶
SnowConvert AI reports SSC-FDM-RS0014 while converting Redshift code because the Snowflake result is not the same as the source. The restrict keyword was removed, applied by default in Snowflake. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0014 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0015¶
The procedure name was renamed to a valid Snowflake identifier.
Description¶
SnowConvert AI reports SSC-FDM-RS0015 while converting Redshift code because the Snowflake result is not the same as the source. The procedure name was renamed to a valid Snowflake identifier. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0015 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0016¶
The procedure moved to a renamed schema while other objects did not.
Description¶
SnowConvert AI reports SSC-FDM-RS0016 while converting Redshift code because the Snowflake result is not the same as the source. The procedure moved to a renamed schema while other objects did not. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0016 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0017¶
MAXERROR has no COPY INTO counterpart, so the load now aborts on the first bad row.
Description¶
SnowConvert AI reports SSC-FDM-RS0017 while converting Redshift code because the Snowflake result is not the same as the source. Maxerror has no copy into counterpart, so the load now aborts on the first bad row. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0017 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0018¶
Redshift CONVERT to TIMESTAMP may interpret digit-only strings differently in Snowflake.
Description¶
SnowConvert AI reports SSC-FDM-RS0018 while converting Redshift code because the Snowflake result is not the same as the source. Redshift convert to timestamp reads digit-only strings as calendar dates. Snowflake cast may read them as unix epoch offsets. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0018 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0019¶
Redshift REAL uses single precision while Snowflake REAL uses double precision.
Description¶
SnowConvert AI reports SSC-FDM-RS0019 while converting Redshift code because the Snowflake result is not the same as the source. Redshift real uses single precision. Snowflake real uses double precision, so values may differ. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0019 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0020¶
Redshift TEXT_TO_NUMERIC_ALT converts an empty string to zero while Snowflake TRY_TO_NUMBER returns NULL.
Description¶
SnowConvert AI reports SSC-FDM-RS0020 while converting Redshift code because the Snowflake result is not the same as the source. Redshift TEXT_TO_NUMERIC_ALT converts an empty string to zero. Snowflake TRY_TO_NUMBER returns null for the same input. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0020 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0021¶
OVERWRITE was removed because Snowflake rejects OVERWRITE beside PARTITION BY, and existing partition files are not overwritten.
Description¶
SnowConvert AI reports SSC-FDM-RS0021 while converting Redshift code because the Snowflake result is not the same as the source. Overwrite was removed because Snowflake rejects overwrite beside partition by (002328), and existing partition files are not overwritten the way Redshift allowoverwrite would. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0021 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0022¶
REMOVEQUOTES was mapped to FIELD_OPTIONALLY_ENCLOSED_BY, which parses the character as an optional enclosure instead of only stripping quotes.
Description¶
SnowConvert AI reports SSC-FDM-RS0022 while converting Redshift code because the Snowflake result is not the same as the source. FIELD_OPTIONALLY_ENCLOSED_BY replaces removequotes. Redshift only strips the surrounding quotes, while Snowflake parses the character as an optional enclosure, including its escape rules. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0022 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0023¶
The COPY REGION option was removed because a Snowflake COPY INTO location does not take a region.
Description¶
SnowConvert AI reports SSC-FDM-RS0023 while converting Redshift code because the Snowflake result is not the same as the source. The copy region option was removed because a Snowflake copy into location does not take a region. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0023 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0024¶
FILE_EXTENSION is ignored when SINGLE = TRUE.
Description¶
SnowConvert AI reports SSC-FDM-RS0024 while converting Redshift code because the Snowflake result is not the same as the source. Redshift extension was translated to FILE_EXTENSION beside single = true. Snowflake ignores FILE_EXTENSION when single = true, so the unloaded file does not receive that extension. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0024 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0025¶
ON_ERROR = CONTINUE skips a bad row instead of replacing the failed value.
Description¶
SnowConvert AI reports SSC-FDM-RS0025 while converting Redshift code because the Snowflake result is not the same as the source. Snowflake ON_ERROR = continue skips a row containing a conversion error. Redshift ignoreallerrors keeps the row and replaces the failed value. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0025 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0026¶
Redshift session configuration parameter has no Snowflake counterpart.
Description¶
SnowConvert AI reports SSC-FDM-RS0026 while converting Redshift code because the Snowflake result is not the same as the source. Redshift session configuration parameter has no Snowflake counterpart. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0026 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.
SSC-FDM-RS0029¶
Redshift truncates or rounds half to even when it casts a fractional value to an integer, while Snowflake rounds half away from zero.
Description¶
SnowConvert AI reports SSC-FDM-RS0029 while converting Redshift code because the Snowflake result is not the same as the source. Redshift truncates a fractional value from table rows and rounds a floating-point constant half to even when it casts the value to an integer type. Snowflake rounds half away from zero, so values may differ. The sample below is a verified conversion, and the Snowflake statement includes the marker the product emits.
Code Example¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Best Practices¶
Compare the converted statement with the Redshift behavior that SSC-FDM-RS0029 describes. If that difference changes the result your workload needs, adjust the Snowflake statement before you run it.