User‑Defined Aggregate Functions

Aggregate functions perform an operation on a set of values and return one value. Vertica provides standard built-in aggregate functions such as AVG, MAX, and MIN. User-defined aggregate functions (UDAFs) provide similar functionality:

  • Support a single input column (or set) of values and provide a single output column.
  • Support RLE decompression. RLE input is decompressed before it is sent to a UDAF.
  • Support use with GROUP BY and HAVING clauses. Only columns appearing in the GROUP BY clause can be selected.

Restrictions

The following restrictions apply to UDAFs:

  • Available for C++ only.
  • Cannot be used with correlated subqueries.

In This Section