BIGINT data type
An 8-byte integer data type used in
CREATE TABLE and
In the column definition of a
CREATE TABLE statement:
Range: -9223372036854775808 .. 9223372036854775807. There is no
Conversions: Impala automatically converts to a floating-point type
DOUBLE) automatically. Use
CAST() to convert to
TIMESTAMP. Casting an integer or floating-point
TIMESTAMP produces a
value that is
N seconds past the start of the epoch
date (January 1, 1970). By default, the result value represents a date
and time in the UTC time zone. If the setting
is in effect, the resulting
TIMESTAMP represents a
date and time in the local time zone.
CREATE TABLE t1 (x BIGINT);
SELECT CAST(1000 AS BIGINT);
BIGINT is a convenient type to use for column declarations because you can use any kind of
integer values in
INSERT statements and they are promoted to
BIGINT also requires the most bytes of any integer type on disk and in
memory, meaning your queries are not as efficient and scalable as possible if you overuse this type.
Therefore, prefer to use the smallest integer type with sufficient range to hold all input values, and
CAST() when necessary to the appropriate type.
For a convenient and automated way to check the bounds of the
BIGINT type, call the
If an integer value is too large to be represented as a
BIGINT, use a
DECIMAL instead with sufficient digits of precision.
NULL considerations: Casting any non-numeric value to this type produces a
Partitioning: Prefer to use this type for a partition key column. Impala can process the numeric
type more efficiently than a
STRING representation of the value.
HBase considerations: This data type is fully compatible with HBase tables.
Text table considerations: Values of this type are potentially larger in text tables than in tables using Parquet or other binary formats.
Internal details: Represented in memory as an 8-byte value.
Added in: Available in all versions of Impala.
Column statistics considerations: Because this type has a fixed size, the maximum and average size
fields are always filled in for column statistics, even before you run the