Click to copy
Functions And Operators • Reviewed for ksqlDB 0.29
How to Use Aggregation Functions in ksqlDB
Aggregation functions put several rows of data together. They do this by applying a certain rule. For example, the MAX
function will get the maximum value from all the values within a group.
In ksqlDB, aggregation functions need to be used in combination with the GROUP BY
clause.
To find out what aggregation functions are available, list all the functions and look at the ones marked with the AGGREGATE
category.
Function Name | Category
--------------------------------------------
AVG | AGGREGATE
COLLECT_LIST | AGGREGATE
COLLECT_SET | AGGREGATE
COUNT | AGGREGATE
COUNT_DISTINCT | AGGREGATE
EARLIEST_BY_OFFSET | AGGREGATE
HISTOGRAM | AGGREGATE
LATEST_BY_OFFSET | AGGREGATE
MAX | AGGREGATE
MIN | AGGREGATE
STDDEV_SAMP | AGGREGATE
STDDEV_SAMPLE | AGGREGATE
SUM | AGGREGATE
SUM_LIST | AGGREGATE
TOPK | AGGREGATE
TOPKDISTINCT | AGGREGATE
Was this article helpful?