What are the Hadoop HIVE Data Types ?

In this tutorial we will go over the Hive Data Types and give some examples for each of  the data type.  Hive supports most of the primitive data types supported by many relational databases. We have Primary and Complex Data Types available in Hive. 

What are the Primary Data Types ?

Primitive types are the most basic data types Primary types also have 4 categories :
  • Numeric Types
  • String Types
  • Date/Time Types
  • Miscellaneous Types
Numeric Types
  • TINYINT (1-byte signed integer, from -128 to 127)
  • SMALLINT (2-byte signed integer, from -32,768 to 32,767)
  • INT (4-byte signed integer, from -2,147,483,648 to 2,147,483,647)
  • BIGINT (8-byte signed integer, from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)
  • FLOAT (4-byte single precision floating point number)
  • DOUBLE (8-byte double precision floating point number)
  • DECIMAL  Introduced in Hive 0.11.0 with a precision of 38 digits, Hive 0.13.0 introduced user definable precision and scale
String Types
  • STRING
  • VARCHAR (Note: Only available starting with Hive 0.12.0)
  • CHAR (Note: Only available starting with Hive 0.13.0)
Date/Time Types
  • TIMESTAMP (Note: Only available starting with Hive 0.8.0)
  • DATE (Note: Only available starting with Hive 0.12.0)
Misc Types
  • BOOLEAN
  • BINARY (Note: Only available starting with Hive 0.8.0)

What are the Complex Data Types ?

This are collection of primary data type. Complex Types can be built up from primitive types and other composite types. Data type of the fields in the collection are specified using an angled bracket notation.
  • arrays: ARRAY
  • maps: MAP
  • structs: STRUCT
  • union: UNIONTYPE