SSC-FDM-0033

Sample clause behaves differently in Snowflake.

Description

This message is generated to showcase the functional difference while sampling rows in Snowflake. The difference are related to the quantity of rows retrieved. When in Teradata there is the same quantity of rows in the non-deterministic output, it may change in Snowflake and return a few rows more or less. This is because a probability related topic and it is expected to behaves like that in Snowflake.

If there is a requirement of retrieven the same values and the same quantity, a deterministic output, it is recomended to use a seed in the Snowflake query.

Example Code

Input Code (Teradata):

IN -> Teradata_01.sql
SELECT * FROM Employee SAMPLE 2;
SELECT * FROM Employee SAMPLE 0.25;

Output Code:

OUT -> Teradata_01.sql
SELECT
    * FROM
    Employee
--** SSC-FDM-0033 - SAMPLE CLAUSE BEHAVES DIFFERENTLY IN SNOWFLAKE **
SAMPLE(2 ROWS);

SELECT
    * FROM
    Employee
--** SSC-FDM-0033 - SAMPLE CLAUSE BEHAVES DIFFERENTLY IN SNOWFLAKE **
SAMPLE(25);

Recommendations

Last updated