Arcadia Engine's analytical views support aggregate functions.
Arcadia Engine supports these Impala aggregate functions in Analytical Views:
APPX_MEDIAN()
, AVG()
, COUNT()
,
GROUP_CONCAT()
, MAX()
, MIN()
,
NDV()
, SAMPLE()
, STDDEV()
,
STDDEV_SAMP()
, STDDEV_POP()
,
SUM()
, VARIANCE()
,
VARIANCE_SAMP()
, VARIANCE_POP()
,
VAR_SAMP()
, and VAR_POP()
. See Impala Aggregate Functions.
Analytical Views also support Arcadia's proprietary NDVP()
, BOOLEAN_AND()
, BOOLEAN_OR()
, and GCDO()
, as well as user-defined
functions.
To enable aggregate functions in the analytical view, simply add them to the 'select list' of the analytical view. Queries that contain these aggregate functions are automatically routed to the analytical view, provided they meet the necessary conditions.
The following steps demonstrate how to implement an aggregate that uses the
NDV()
function.
create analytical view aview1 stored as parquet
as select name, ndv(event_id) from events group by name;
refresh analytical view aview1;
explain select ndv(event_id) from events;
'REWR :''SELECT ndv_bigint_finalize('_c1') 'ndv(event_id)' FROM default.aview1 aview1'