Impala Aggregate Functions
Aggregate functions are a special category with different rules. These functions
calculate a return value across all the items in a result set, so they require a
FROM
clause in the query:
select count(product_id) from product_catalog;
select max(height), avg(height) from census_data where age > 20;
Aggregate functions also ignore NULL
values rather than returning a
NULL
result. For example, if some rows have NULL
for a
particular column, those rows are ignored when computing the AVG()
for
that column. Likewise, specifying COUNT(col_name)
in
a query counts only those rows where col_name contains a
non-NULL
value.