Aggregate Functions

The following are aggregate functions for KSQL.

Table 1.
Function Example Description
COUNT COUNT(col1) Counts the number of rows.
MAX MAX(col1) Returns the maximum value for a given column and window.
MIN MIN(col1) Returns the minimum value for a given column and window.
SUM SUM(col1) Sums the column values.
TOPK TOPK(col1, K) Returns the TopK values for the given column and window.
TOPKDISTINCT TOPKDISTINCT(col1, K) Returns the distinct TopK values for the given column and window.