SSC-FDM-RS0005
Duplicates not allowed in source table
Description
In Redshift, the MERGE statement throws an error when the source table has duplicate values. Snowflake doesn't throw the error and instead, it allows the query execution. The FDM warns about this behavior, that it could change the result in the converted MERGE.
Code Example
Input Code:
MERGE INTO target USING source ON target.id = source.id
WHEN MATCHED THEN DELETE
WHEN NOT MATCHED THEN INSERT VALUES (source.id, source.name);
Output Code:
--** SSC-FDM-RS0005 - REDSHIFT MERGE STATEMENT DOESN'T ALLOW DUPLICATES IN THE SOURCE TABLE. SNOWFLAKE BEHAVIOR MAY DIFFER IF THERE ARE DUPLICATE VALUES. **
MERGE INTO target USING source ON target.id = source.id
WHEN MATCHED THEN DELETE
WHEN NOT MATCHED THEN INSERT VALUES (source.id, source.name);
Recommendations
If you need more support, you can email us at [email protected]
Last updated