Hive Data Types

Dremio supports selecting the following Hive Database types. The following table shows the mappings from Hive to Dremio data types.

[info] Note: If a type is not present in the table, it is not currently supported.

Data Type Mappings

Hive Database Type Dremio Type
BINARY varbinary
BOOLEAN boolean
BYTE integer
CHAR varchar
DATE date
DECIMAL double
DOUBLE double
FLOAT float
INT integer
LONG bigint
SHORT integer
STRING varchar
TIMESTAMP timestamp
VARCHAR varchar

Complex Data Types

As of Dremio 3.2, the following complex data types are supported:

  • LIST: Supports extracting list elements using list indices.
  • STRUCT: Supports extracting struct fields using field names within single quotes.
  • UNION: Supports reading data from Union type field from Hive ORC tables.

**[info] Not Supported Complex data types from Hive parquet format are not supported (only ORC is supported).

Complex Data Type Mapping

Hive Database Type Dremio Type

Examples for LIST, STRUCT, and UNION

The following examples assume that the table, HiveOrcTable, exists in Hive and has the following structure:

HiveOrcTable Table Structure

Column Name Hive Data Type
list_field ARRAY
struct_field STRUCT
union_field UNIONTYPE

LIST example

In this example, list_field is the column name whose data type is ARRAY in Hive:

SELECT list_field[0] from HiveOrcTable

STRUCT example

In this example, struct_field is the column name whose data type is STRUCT in Hive:

SELECT struct_field[‘field_name’] from HiveOrcTable

UNION example

In this example, union_field is the column name whose data type is UNIONTYPE in Hive:

SELECT union_field FROM HiveOrcTable

results matching ""

    No results matching ""