Data Type Mapping between Advanced SQL Engine , ODBC Driver, tdplyr tibble, and R - 17.00 - Data Type Mapping between Advanced SQL Engine, ODBC Driver, tdplyr tibble, and R - Teradata R Package

Teradata® R Package User Guide

Teradata R Package
November 2020
User Guide

This table lists the data type mapping between Advanced SQL Engine, ODBC driver, tdplyr tibble, and R.

Advanced SQL Engine Data Type ODBC Driver tdplyr tibble R Notes
INTEGER 4 int integer  
BIGINT -5 bigint double  
BYTEINT -6 byteint integer  
DECIMAL(p,q) / NUMERIC 3 decimal numeric Defaults to DECIMAL(5,0), when p and q are not specified.
NUMBER(p,q) 3 decimal numeric  
DOUBLE_PRECISION 6 float double  
FLOAT 6 float double  
REAL 6 float double  
SMALLINT 5 smallint integer  
DATE 91 date date  
TIME 92 time difftime  
TIME_WITH_TIME_ZONE 92 time difftime TIME ZONE is discarded in the R data frame.
TIMESTAMP 93 timestamp POSIXct  
TIMESTAMP_WITH_TIME_ ZONE 93 timestamp POSIXct TIME ZONE is discarded in the R data frame.
INTERVAL_YEAR 101 interval_year character  
INTERVAL_MONTH 102 interval_month character  
INTERVAL_DAY 103 interval_day character  
INTERVAL_HOUR 104 interval_hour character  
INTERVAL_MINUTE 105 interval_minute character  
INTERVAL_SECOND 106 interval_second character  
INTERVAL_YEAR_TO_MONTH 107 interval_year_to_month character  
INTERVAL_DAY_TO_HOUR 108 interval_day_to_hour character  
INTERVAL_DAY_TO_MINUTE 109 interval_day_to_minute character  
INTERVAL_DAY_TO_SECOND 110 interval_day_to_second character  
INTERVAL_HOUR_TO_MINUTE 111 interval_hour_to_minute character  
INTERVAL_HOUR_TO_SECOND 112 interval_hour_to_second character  
INTERVAL_MINUTE_TO_SECOND 113 interval_minute_to_second character  
PERIOD_DATE -1049 period_date character  
PERIOD_TIME -1048 period_time character  
PERIOD_TIME_WITH_TIME_ ZONE -1047 period_time_with_time_zone character  
PERIOD_TIMESTAMP -1046 period_timestamp character  
PERIOD_TIMESTAMP_WITH_TIME_ZONE -1045 period_timestamp_with_time_zone character  
CHAR 1 char character  
VARCHAR 12 varchar character  
LONG_VARCHAR 12 varcha character  
BYTE -2 byte raw  
VARBYTE -3 varbyte blob  
BLOB -4 blob blob  
CLOB -1 varchar character  
JSON -1 varchar character  
XML 18003 xml character