Hive supports several date types like
- Hive Numeric Types
- Hive Date & Time Types
- Hive String Types
- Hive Misc Types (Boolean & Binary)
- Hive Complex Types (Array, Map, Struct)
<a name="hive-numeric-types"></a>
Hive Numeric Types
Below are Numeric Types Hive support and their sizes.
Table1 - Hive Numeric Types
<a name="hive-date-time-types"></a>
Hive Date/Time Types
Below are Hive Date and Timestamp types, these were not available in the initial versions of the Hive and added in later releases. Date type is used to store just Date and Timestamp is used to store both date and time.
Hive provides several Date & Time functions, you should use these to perform any date & time operations.
Table2 - Hive Date/Time Types
<a name="hive-string-types"></a>
Hive String Types
Similar to SQL, Hive also supports CHAR and VARCHAR types, and additionally, it also supports STRING type.
Hive provides several String functions, you should use these to perform any string operations.
Table3 - Hive String Types
<a name="hive-boolean-binary-types"></a>
Hive Misc Types
Table4 - Hive Boolean/Binary Types
<a name="hive-complex-types"></a>
Hive Complex Types
Similar to Spark, Hive also support complex data types which includes Array, Map, Struct and union. Array is used to store the list of elements. Map is used to store key/value pair. Struct is for parent and child assosiations.
To work with Complex types, you should use Hive Collection Map & Array functions
Table5 - Hive Complex Types
Happy Learning !!
<a name="h-related-articles"></a>
