skip to main content
Querying data stores with SQL : Supported data types : Apache Hive data types
  

Try Now

Apache Hive data types

The following table shows how the Apache Hive data types are mapped to the standard data types for ODBC and JDBC.
Note: When the EnableWCharSupport connection parameter is set to true for the Hybrid Data Pipeline Driver for ODBC, character types are mapped to the corresponding ODBC W-Types. For example, the varchar(max) type is mapped to the Unicode type SQL_WLONGVARCHAR.
Table 152. Apache Hive data types
Apache Hive type
JDBC type
ODBC data type
ARRAY
VARCHAR
SQL_WVARCHAR(-9) or SQL_WVARCHAR(12)
BIGINT
BIGINT
SQL_BIGINT(type-5)
BINARY
VARBINARY
SQL_VARBINARY(-3)
BOOLEAN
BOOLEAN
SQL_BIT(type-7)
CHAR
CHAR
SQL_WCHAR(-8 or SQL_CHAR(1)
DATE
DATE
SQL_TYPE_DATE(91) or SQL_TYPE_TIMESTAMP(93)
DECIMAL
DECIMAL
SQL_DECIMAL(3)
DOUBLE
DOUBLE
SQL_DOUBLE(8)
FLOAT
REAL
SQL_REAL(7)
INT
INTEGER
SQL_INTEGER(4)
MAP
VARCHAR
SQL_WVARCHAR(-9) or SQL_WVARCHAR(12)
SMALLINT
SMALLINT
SQL_SMALLINT(5)
STRING
VARCHAR or LONGVARCHAR 1
SQL_WVARCHAR(-9) or SQL_WVARCHAR(12)
SQL_WLONGVARCHAR(-10) or SQL_LONGVARCHAR(-1)
STRUCT
VARCHAR
SQL_WVARCHAR(-9) or SQL_WVARCHAR(12)
TIMESTAMP
TIMESTAMP
SQL_TYPE_TIMESTAMP(93)
TINYINT
TINYINT
SQL_TINYINT(-6)
UNION
VARCHAR
SQL_WVARCHAR(-9) or SQL_WVARCHAR(12)
VARCHAR
VARCHAR
SQL_WVARCHAR(-9) or SQL_WVARCHAR(12)

1 If the StringDescribeType parameter is set to varchar (the default), this data type maps to VARCHAR. If set to longvarchar, this data type maps to LONGVARCHAR.