Apache Hive : Literals

Last updated: December 12, 2024

Apache Hive : Literals

Literals

Integral types

Integral literals are assumed to be INT by default, unless the number exceeds the range of INT in which case it is interpreted as a BIGINT, or if one of the following postfixes is present on the number.

TypePostfixExample
TINYINTY100Y
SMALLINTS100S
BIGINTL100L
String types

String literals can be expressed with either single quotes (’) or double quotes ("). Hive uses C-style escaping within the strings.

Floating point types

Floating point literals are assumed to be DOUBLE. Scientific notation is not yet supported.