SSC-FDM-OR0019
Window frame output may not be equivalent
Description
This warning is added when a ROWS window frame unit is found within the source code.
ROWS works by using physical row numbers for its computing, which may differ once it is migrated to the target platform. Manually adding extra ORDER BY clauses can help mitigate or remove this issue.
Example Code
Input Code:
SELECT
SUM(C_BIRTH_DAY)
OVER (
ORDER BY C_BIRTH_COUNTRY
ROWS UNBOUNDED PRECEDING) AS MAX1
FROM WINDOW_TABLE;
Output Code:
SELECT
SUM(C_BIRTH_DAY)
OVER (
ORDER BY C_BIRTH_COUNTRY ROWS UNBOUNDED PRECEDING /*** SSC-FDM-OR0019 - WINDOW FRAME OUTPUT MAY NOT BE EQUIVALENT ***/) AS MAX1
FROM
WINDOW_TABLE;
Recommendations
Ensure deterministic ordering for rows to ensure deterministic outputs when running in Snowflake.
If you need more support, you can email us at snowconvert-support@snowflake.com
Last updated