HIVE Data Types
Hive data types are categorized in numeric types, string types, misc types, and complex types. A list of Hive data types is given below.
||1-byte signed integer
||-128 to 127
||2-byte signed integer
||32,768 to 32,767
||4-byte signed integer
||2,147,483,648 to 2,147,483,647
||8-byte signed integer
||-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
||Single precision floating point number
||Double precision floating point number
- It supports traditional UNIX timestamp with optional nanosecond precision.
- As Integer numeric type, it is interpreted as UNIX timestamp in seconds.
- As Floating point numeric type, it is interpreted as UNIX timestamp in seconds with decimal precision.
- As string, it follows java.sql.Timestamp format "YYYY-MM-DD HH:MM:SS.fffffffff" (9 decimal place precision)
The Date value is used to specify a particular year, month and day, in the form YYYY--MM--DD. However, it didn't provide the time of the day. The range of Date type lies between 0000--01--01 to 9999--12--31.
The string is a sequence of characters. It values can be enclosed within single quotes (') or double quotes (").
The varchar is a variable length type whose range lies between 1 and 65535, which specifies that the maximum number of characters allowed in the character string.
The char is a fixed-length type whose maximum length is fixed at 255.
||It is similar to C struct or an object where fields are accessed using the "dot" notation.
||It contains the key-value tuples where the fields are accessed using array notation.
||It is a collection of similar type of values that indexable using zero-based integers.