Hive commonly used data types

table of Contents

1. Digital

2. Date and time

3. String class

4. Misc category

5. Composite class


1. Digital

Types of length Remarks
TINYINT 1 byte Signed integer
SMALLINT 2 bytes Signed integer
INT 4 bytes Signed integer
BIGINT 8 bytes Signed integer
FLOAT 4 bytes Signed single precision floating point
DOUBLE 8 bytes Signed double-precision floating-point number
DECIMAL -- Exact numeric string with decimals

2. Date and time

Types of length Remarks
TIMESTAMP -- Timestamp, content format: yyyy-mm-dd hh:mm:ss[.f...]
DATE -- Date, content format: YYYYMMDD
INTERVAL -- --

3. String class

Types of length Remarks
STRING -- String
VARCHAR Character range 1-65535 String of variable length
CHAR Maximum number of characters: 255 Fixed-length string

4. Misc category

Types of length Remarks
BOOLEAN -- Boolean type TRUE/FALSE
BINARY -- Byte sequence

5. Composite class

Types of length Remarks
ARRAY -- An array containing elements of the same type, the index starts from 0 ARRAY<data_type>
MAP -- 字典 MAP<primitive_type, data_type>
STRUCT -- Structure STRUCT<col_name: data_type [COMMENT col_comment], ...>
UNIONTYPE -- Union UNIONTYPE<data_type, data_type, ...>

Guess you like

Origin blog.csdn.net/qq_35995514/article/details/108553694