Built-in Functions
This page provides a description of the translation for the built-in functions in Teradata to Snowflake
This page only lists the functions that are already transformed by SnowConvert, if a function from the Teradata documentation is not listed there then it should be taken as unsupported.
Some Teradata functions do not have a direct equivalent in Snowflake so they are transformed into a functional equivalent UDF, these can be easily spotted by the _UDF postfix in the name of the function. For more information on the UDFs SnowConvert uses check this git repository.
Aggregate Functions
Teradata | Snowflake | Note |
---|---|---|
AVG | AVG | |
CORR | CORR | |
COUNT | COUNT | |
COVAR_POP | COVAR_POP | |
COVAR_SAMP | COVAR_SAMP | |
GROUPING | GROUPING | |
KURTOSIS | KURTOSIS | |
MAXIMUM MAX | MAX | |
MINIMUM MIN | MIN | |
PIVOT | PIVOT | Check PIVOT. |
REGR_AVGX | REGR_AVGX | |
REGR_AVGY | REGR_AVGY | |
REGR_COUNT | REGR_COUNT | |
REGR_INTERCEPT | REGR_INTERCEPT | |
REGR_R2 | REGR_R2 | |
REGR_SLOPE | REGR_SLOPE | |
REGR_SXX | REGR_SXX | |
REGR_SXY | REGR_SXY | |
REGR_SYY | REGR_SYY | |
SKEW | SKEW | |
STDDEV_POP | STDDEV_POP | |
STDDEV_SAMP | STDDEV_SAMP | |
SUM | SUM | |
UNPIVOT | UNPIVOT | Unpivot with multiple functions not supported in Snowflake |
VAR_POP | VAR_POP | |
VAR_SAMP | VAR_SAMP |
Arithmetic, Trigonometric, Hyperbolic Operators/Functions
Teradata | Snowflake | Note |
---|---|---|
ABS | ABS | |
CEILING | CEIL | |
DEGREES | DEGREES | |
EXP | EXP | |
FLOOR | FLOOR | |
HYPERBOLIC ACOSH ASINH ATANH COSH SINH TANH | HYPERBOLIC ACOSH ASINH ATANH COSH SINH TANH | |
LOG | LOG | |
LN | LN | |
MOD | MOD | |
NULLIFZERO(param) | CASE WHEN param=0 THEN null ELSE param END | |
POWER | POWER | |
RANDOM | RANDOM | |
RADIANS | RADIANS | |
ROUND | ROUND | |
SIGN | SIGN | |
SQRT | SQRT | |
TRUNC | TRUNC_UDF | |
TRIGONOMETRIC ACOS ASIN ATAN ATAN2 COS SIN TAN | TRIGONOMETRIC ACOS ASIN ATAN ATAN2 COS SIN TAN | |
ZEROIFNULL | ZEROIFNULL |
See Arithmetic, Trigonometric, Hyperbolic Operators/Functions
Attribute Functions
Teradata | Snowflake | Note |
---|---|---|
BIT_LENGTH | BIT_LENGTH | |
BYTE BYTES | LENGTH | |
CHAR CHARS CHARACTERS | LEN | |
CHAR_LENGTH CHARACTER_LENGTH | LEN | |
MCHARACTERS | LENGTH | |
OCTECT_LENGTH | OCTECT_LENGTH |
Bit/Byte Manipulation Functions
Teradata | Snowflake | Note |
---|---|---|
BITAND | BITAND | |
BITNOT | BITNOT | |
BITOR | BITOR | |
BITXOR | BITXOR | |
GETBIT | GETBIT |
Built-In (System Functions)
Teradata | Snowflake | Note |
---|---|---|
ACCOUNT | CURRENT_ACCOUNT | |
CURRENT_DATE CURDATE | CURRENT_DATE | |
CURRENT_ROLE | CURRENT_ROLE | |
CURRENT_TIME CURTIME | CURRENT_TIME | |
CURRENT_TIMESTAMP | CURRENT_TIMESTAMP | |
DATABASE | CURRENT_DATABASE | |
DATE | CURRENT_DATE | |
NOW | CURRENT_TIMESTAMP | |
PROFILE | CURRENT_ROLE | Check MSCEWI2068 for more details on this transformation |
SESSION | CURRENT_SESSION | |
TIME | CURRENT_TIME | |
USER | CURRENT_USER |
Business Calendars
Teradata | Snowflake | Note |
---|---|---|
DAYNUMBER_OF_MONTH(DatetimeValue, 'COMPATIBLE') | DAYOFMONTH | |
DAYNUMBER_OF_MONTH(DatetimeValue, 'ISO') | DAYNUMBER_OF_MONTH_ISO_UDF | |
DAYNUMBER_OF_MONTH(DatetimeValue, 'TERADATA') | DAYOFMONTH | |
DAYNUMBER_OF_WEEK(DatetimeValue, 'ISO') | DAYOFWEEKISO | |
DAYNUMBER_OF_WEEK(DatetimeValue, 'COMPATIBLE') | DAY_OF_WEEK_COMPATIBLE_UDF | |
DAYNUMBER_OF_WEEK(DatetimeValue, 'TERADATA') DAYNUMBER_OF_WEEK(DatetimeValue) | TD_DAY_OF_WEEK_UDF | |
DAYNUMBER_OF_YEAR(DatetimeValue, 'ISO') | PUBLIC.DAY_OF_YEAR_ISO_UDF | |
DAYNUMBER_OF_YEAR(DatetimeValue) | DAYOFYEAR | |
QUARTERNUMBER_OF_YEAR | QUARTER | |
TD_SUNDAY(DateTimeValue) | PREVIOUS_DAY(DateTimeValue, 'Sunday') | |
WEEKNUMBER_OF_MONTH | WEEKNUMBER_OF_MONTH_UDF | |
WEEKNUMBER_OF_QUARTER(dateTimeValue) | WEEKNUMBER_OF_QUARTER_UDF | |
WEEKNUMBER_OF_QUARTER(dateTimeValue, 'ISO') | WEEKNUMBER_OF_QUARTER_ISO_UDF | |
WEEKNUMBER_OF_QUARTER(dateTimeValue, 'COMPATIBLE') | WEEKNUMBER_OF_QUARTER_COMPATIBLE_UDF | |
WEEKNUMBER_OF_YEAR(DateTimeValue, 'ISO') | WEEKISO | |
YEARNUMBER_OF_CALENDAR(DATETIMEVALUE, 'COMPATIBLE') | YEAR | |
YEARNUMBER_OF_CALENDAR(DATETIMEVALUE, 'ISO') | YEAROFWEEKISO |
Calendar Functions
Teradata | Snowflake | Note |
---|---|---|
DAYNUMBER_OF_WEEK(DatetimeValue) | TD_DAY_OF_WEEK_UDF | |
DAYNUMBER_OF_WEEK(DatetimeValue, 'COMPATIBLE') | DAY_OF_WEEK_COMPATIBLE_UDF | |
QuarterNumber_Of_Year(DatetimeValue, 'ISO') | QUARTER_OF_YEAR_ISO_UDF(DatetimeValue) | |
TD_DAY_OF_CALENDAR | TD_DAY_OF_CALENDAR_UDF | |
TD_DAY_OF_MONTH DAYOFMONTH | DAYOFMONTH | |
TD_DAY_OF_WEEK DAYOFWEEK | TD_DAY_OF_WEEK_UDF | |
TD_DAY_OF_YEAR |