skip to main content
The Connect XE Drivers : The Driver for Apache Hive : Data Types
 

Try DataDirect Drivers Now

Data Types

The following table shows how the Apache Hive data types are mapped to the standard ODBC data types.
Table 84. Apache Hive Data Types
Apache Hive
ODBC
Bigint
SQL_BIGINT
Boolean
SQL_BIT
Char1
SQL_CHAR
Date2
SQL_DATE
Decimal3, 4
SQL_DECIMAL
Double
SQL_DOUBLE
Float
SQL_REAL
Int
SQL_INTEGER
Smallint
SQL_SMALLINT
String5
SQL_VARCHAR6
Timestamp7
SQL_TYPE_TIMESTAMP
Tinyint
SQL_TINYINT
Varchar8
SQL_VARCHAR

1 Supported only with Apache Hive 0.13.0 and higher.

2 Supported only with Apache Hive 0.12.0 and higher

3 Supported only with Apache Hive 0.11.0 and higher.

4 The default precision and scale for the DECIMAL data type changed in Hive 0.13. For versions prior to Hive 0.13, the precision and scale are fixed and limited to 38 digits each. For Hive 0.13 and higher, the precision and scale are flexible with a default of 10 digits for precision and 0 digits for scale. When upgrading to Hive 0.13, you may need to change the length of precision and scale to avoid the rounding of values that exceed the default length. Refer to the Apache Hive user documentation for more information: https://cwiki.apache.org/confluence/display/Hive/Home.

5 The StringDescribeType connection option setting determines where this data type maps. For example, if set to sql_varchar (the default), this data type maps to SQL_VARCHAR

6 Maximum of 2 GB

7 Supported only with Apache Hive 0.8.0 and higher.

8 Supported only with Apache Hive 0.12.0 and higher