Built-in functions

Aggregate Functions

Aggregate functions compute a single result value from a set of input values. (Greenplum Language Reference Aggregate Functions).

Greenplum
Snowflake

Notes: Redshift and Snowflake may show different precision/decimals due to data type rounding/formatting.

Conditional expressions

Greenplum
Snowflake

Notes: Redshift's NULLIF ignores trailing spaces in some string comparisons, unlike Snowflake. Therefore, the transformation adds RTRIM for equivalence.

Data type formatting functions

Data type formatting functions provide an easy way to convert values from one data type to another. For each of these functions, the first argument is always the value to be formatted and the second argument contains the template for the new format. (Greenplum Language Reference Data type formatting functions).

Greenplum
Snowflake

Date and time functions

Greenplum
Snowflake

Notes: Greenplum defaults to UTC; the Snowflake function requires explicit UTC specification. Therefore, it will be added as the target timezone.

Notes: Invalid date part formats are translated to Snowflake-compatible formats.

Greenplum timestamps default to microsecond precision (6 digits); Snowflake defaults to nanosecond precision (9 digits). Adjust precision as needed using ALTER SESSION (e.g., ALTER SESSION SET TIMESTAMP_OUTPUT_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF2';). Precision loss may occur depending on the data type used.

JSON Functions

Redshift
Snowflake

Notes:

  1. Greenplum treats newline, tab, and carriage return characters literally; Snowflake interprets them.

  2. A JSON literal and dot-separated path are required to access nested objects in the Snowflake function.

  3. Paths with spaces in variables must be quoted.

Math functions

Greenplum
Snowflake

Greenplum and Snowflake results may differ in scale.

String functions

String functions process and manipulate character strings or expressions that evaluate to character strings. (Greenplum Language Reference String functions).

Greenplum
Snowflake

Notes: For negative lengths in LEFT/RIGHT, Snowflake returns an empty string; Greenplum raises an error.

Notes: Snowflake and Greenplum handle SPLIT_PART differently with case-insensitive collations.

Notes: Greenplum uses keywords (BOTH, LEADING, TRAILING) for trim; Snowflake uses TRIM, LTRIM, RTRIM.

Window functions

Greenplum
Snowflake

Notes: AVG rounding/formatting can vary by data type between Redshift and Snowflake.

Notes: ORDER BY is mandatory in Snowflake; missing clauses are replaced with ORDER BY 1.

Notes: Snowflake needs ORDER BY; missing clauses get ORDER BY <expr>.

Notes: Snowflake needs ORDER BY; missing clauses get ORDER BY <expr>.

Notes: Redshift allows constant or expression offsets; Snowflake allows only constant offsets.

Notes: ORDER BY is mandatory in Snowflake; missing clauses are replaced with ORDER BY 1.

Notes: ORDER BY is mandatory in Snowflake; missing clauses are replaced with ORDER BY 1.

Notes: Rounding varies between platforms.

Notes: ORDER BY is mandatory in Snowflake; missing clauses are replaced with ORDER BY 1.

Known Issues

  • SSC-EWI-PG0005: Date or time format is not supported in Snowflake.

  • SSC-FDM-0032: Parameter is not a literal value, transformation could not be fully applied

  • SSC-FDM-PG0013: Function syntactically supported by Snowflake but may have functional differences.

  • SSC-FDM-RS0004: Invalid dates will cause errors in Snowflake.

Last updated