Data Types

Hive provides a type system for primitive types as well as complex types. Types are associated with the columns in the tables.

The following primitive types are supported - integer, boolean, string, float, double, decimal, char, varchar, date, timestamp and binary.

Complex types can be built up from primitive types and other composite types using:

  • Structs: the elements within the type can be accessed using the DOT (.) notation.

  • Maps (key-value tuples): The elements are accessed using ['element name'] notation.

  • Arrays (indexable lists): The elements in the array have to be in the same type. Elements can be accessed using the [n] notation where n is an index (zero-based) into the array.

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types

Last updated