Understanding data types

Hive data types are categorized into two types: primitive and complex. String and Int are the most useful primitive types, which are supported by most HQL functions. The details of primitive types are as follows:

ay contain a set of any type of fields. Complex types allow the nesting of types. The details of complex types a

Primitive type Description Example
TINYINT It has 1 byte, from -128 to 127. The postfix is Y. It is used as a small range of numbers. 10Y
SMALLINT It has 2 bytes, from -32,768 to 32,767. The postfix is S. It is used as a regular descriptive number. 10S
INT It has 4 bytes, from -2,147,483,648 to 2,147,483,647. 10
BIGINT It has 8 bytes, from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 ...

Get Apache Hive Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.