Data Types
This section shows equivalents between data types in Teradata and in Snowflake.
Last updated
This section shows equivalents between data types in Teradata and in Snowflake.
Last updated
Teradata | Snowflake | Notes |
---|
For the conversion of integer data types (INTEGER
, SMALLINT
, and BIGINT
), each one is converted to the alias in Snowflake with the same name. Each of those aliases converts to NUMBER(38,0)
, a data type that is considerably larger than the integer datatype. Below is a comparison of the range of values that can be present in each data type:
Teradata INTEGER
: -2,147,483,648 to 2,147,483,647
Teradata SMALLINT
: -32768 to 32767
Teradata BIGINT
: -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
Snowflake NUMBER(38,0)
: -99999999999999999999999999999999999999 to +99999999999999999999999999999999999999
You can see more of the UDF's in the public repository of UDF's currently created by Snowflake SnowConvert.
These UDF's assume that periods are stored in a VARCHAR
where the data/time parts are separated by an *
. For example for a Teradata period like PERIOD('2018-01-01','2018-01-20')
it should be stored in Snowflake as a VARCHAR
like '2018-01-01
*2018-01-20'
.
Input code:
Output code:
Cases where the interval is being multiplied/divided by a numerical expression are transformed to equivalent DATEADD
function calls instead:
Input code:
Output code:
Elements inside a JSON are ordered by their keys when inserted in a table. Thus, the query results might differ. However, this does not affect the order of arrays inside the JSON.
For example, if the original JSON is:
Note how "age" is now the first element. However, the array of "cities" maintains its original order.
No issues were found.
No related EWIs.
See the documentation on Teradata
Warning is generated.
Intervals and Periods are stored as a string (VARCHAR
) in Snowflake. When converting, SnowConvert creates a UDF that recreates the same expression as a string. Warning is generated.
The only exception to the VARCHAR
transformation for intervals are interval literals used to add/subtract values from a Datetime expression, Snowflake does not have an INTERVAL
datatype but exist for the specific purpose mentioned. Examples:
Using the Snowflake that interprets an input string as a JSON document, producing a VARIANT value. The inserted JSON will be:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Not supported |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BIGINT
in Snowflake is an alias for NUMBER(38,0).
[Check out ]
Limited to 8MB. BLOB
is not supported, warning is generated
Limited to 16MB. CLOB
is not supported, warning is generated
INTEGER
in Snowflake is an alias for NUMBER(38,0)
. [Check out ]
Intervals are stored asVARCHAR
in Snowflake except when used in addition/subtraction. [Check out ].
Intervals are stored asVARCHAR
in Snowflake except when used in addition/subtraction. [Check out ].
Intervals are stored asVARCHAR
in Snowflake except when used in addition/subtraction. [Check out ].
Intervals are stored asVARCHAR
in Snowflake except when used in addition/subtraction. [Check out ].
Intervals are stored asVARCHAR
in Snowflake except when used in addition/subtraction. [Check out ].
Elements inside a JSON are ordered by their keys when inserted in a table. [Check out ].
Periods are stored asVARCHAR
in Snowflake. [Check out ].
Periods are stored asVARCHAR
in Snowflake. [Check out ].
Periods are stored asVARCHAR
in Snowflake. [Check out ].
Periods are stored asVARCHAR
in Snowflake. [Check out ].
Periods are stored asVARCHAR
in Snowflake. [Check out ].
SMALLINT
in Snowflake is an alias for NUMBER(38,0).
[Check out ]
Warning is generated.