skip to main content
Part 4: The Connect XE Drivers : The Driver for Apache Hive : Data Types
 
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
Binary1
SQL_VARBINARY
Boolean
SQL_BIT
Char2
SQL_CHAR
Date3
SQL_DATE
Decimal4, 5
SQL_DECIMAL
Double
SQL_DOUBLE
Float
SQL_REAL
Int
SQL_INTEGER
Smallint
SQL_SMALLINT
String6
SQL_VARCHAR7
Timestamp8
SQL_TYPE_TIMESTAMP
Tinyint
SQL_TINYINT
Varchar9
SQL_VARCHAR

1 Supported only with Apache Hive 0.8.1 and higher.

2 Supported only with Apache Hive 0.13.0 and higher.

3 Supported only with Apache Hive 0.12.0 and higher

4 Supported only with Apache Hive 0.11.0 and higher.

5 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.

6 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

7 Maximum of 2 GB

8 Supported only with Apache Hive 0.8.0 and higher.

9 Supported only with Apache Hive 0.12.0 and higher