Database Reference
In-Depth Information
• Impala does not include the metadata definition for ISO-8859-1 or
ISO-8859-2-encoded national language aspect type of data, so you
would need to implement the application-size logic if you want to sup-
port such a requirement.
Here is how casting works with the STRING data type:
Impala does not automatically convert
STRING
to any other type.
The
CAST()
function can be used for converting
STRING
to other data
types, such as
TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE,
or
TIMESTAMP
.
Casting
STRING
values to
BOOLEAN
is not permitted; however,
BOOLEAN
val-
ues
1
and
0
can return as
true
and
false
, respectively.
•
SUM
:
SUM
is an aggregate function, which returns the sum of the set of num-
bers in the table. Here are some key properties of
SUM
functions:
•
SUM
can be used with numeric columns in a table
• You can also use
SUM
with the numeric result of a function or expres-
sion on a column value
• When
SUM
is applied, rows with
NULL
values are ignored
• If a table is empty,
SUM
will return
NULL
as the result
• If all the values supplied to
MIN
are also
NULL
,
SUM
will return
NULL
as the result
The
SUM
function can be used in various ways; here are a few syntaxes using
SUM
:
SELECT SUM(column_name) FROM table_name;
SELECT SUM(distinct(column_name)) FROM
table_name;
SELECT SUM(length(column_name)) FROM
table_name;
•
TIMESTAMP
: A
TIMESTAMP
in Impala represents a point in time when the
TIMESTAMP
data type is used with the
CREATE TABLE
or
ALTER TABLE