SnowConvert AI - Redshift - Literals¶
Description ¶
A literal or constant is a fixed data value, composed of a sequence of characters or a numeric constant. (Redshift SQL Language reference Literals).
Amazon Redshift supports several types of literals, including:
Numeric literals for integer, decimal, and floating-point numbers.
Character literals, also referred to as strings, character strings, or character constants.
Datetime and interval literals, used with datetime data types.
Sample Source Patterns¶
Input Code:¶
Redshift¶
Result¶
integer_literal |
negative_integer |
decimal_literal |
simple_float |
|---|---|---|---|
42 |
-123 |
3.14159 |
1 |
simple_string |
newline_character |
tab_character |
mixed_literal |
|---|---|---|---|
42 |
Line1 Line2 |
Tab Character |
The value is 42 |
Output Code:
Snowflake¶
Result¶
integer_literal |
negative_integer |
decimal_literal |
simple_float |
|---|---|---|---|
42 |
-123 |
3.14159 |
1 |
simple_string |
newline_character |
tab_character |
mixed_literal |
|---|---|---|---|
42 |
Line1 Line2 |
Tab Character |
The value is 42 |
Known Issues¶
This functionality is not currently supported in Snowflake, but it will be supported through a future migration.
Date, time, and timestamp literals¶
Description ¶
Date, time, and timestamp literals supported by Amazon Redshift.(Redshift SQL Language reference Date, Time, Timestamp Literals).
Sample Source Patterns¶
Input Code:¶
Redshift¶
Output Code:
Snowflake¶
Known Issues¶
Some DATE, TIME, and TIMESTAMP formats may produce different results in Redshift compared to Snowflake.
Related EWIs¶
SSC-EWI-RS0007: Date literal is not supported in Snowflake.
Interval Literals¶
Description ¶
Interval literals can be used in datetime calculations, such as, adding intervals to dates and timestamps, summing intervals, and subtracting an interval from a date or timestamp. Interval literals can be used as input values to interval data type columns in a table.. (Redshift SQL Language reference Interval Literals).
Warning
This grammar is partially supported in Snowflake.
Grammar Syntax ¶
Snowflake Intervals can only be used in arithmetic operations. Intervals used in any other scenario are not supported.
The following formats are the only ones recognized and fully transformed by SnowConvert AI, allowing optional fields and most of the abbreviations without interval styles:
Snowflake does not support literals with arithmetic signs. If the Literal contains an hour expression the expression can be partially transformed.
Sample Source Patterns¶
Supported scenarios¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Pending translation scenarios¶
Input Code:¶
Redshift¶
Output Code:¶
Snowflake¶
Known Issues¶
No issues were found.
Related EWIs¶
SSC-EWI-0107: Interval Literal Not Supported In Current Scenario.
SSC-EWI-0073: Pending Functional Equivalence Review.
NULLS¶
Description ¶
If a column in a row is missing, unknown, or not applicable, it is a null value or is said to contain null. (Redshift SQL Language reference Nulls Literals).
Nulls can appear in fields of any data type that are not restricted by primary key or NOT NULL constraints. A null is not equivalent to the value zero or to an empty string.
Sample Source Patterns¶
Input Code:¶
Redshift¶
Result¶
Select1 |
|---|
NULL |
1+NULL |
1*NULL |
|---|---|
NULL |
NULL |
Output Code:
Snowflake¶
Result¶
Select1 |
|---|
NULL |
1+NULL |
1*NULL |
|---|---|
NULL |
NULL |
Known Issues¶
No issues were found.
Related EWIs¶
There are no known issues.