Analytic Functions (UDAnFs)

User-Defined Analytic Functions (UDAnFs) are used for analytics. See SQL Analytics for an overview of Vertica's built-in analytics. Like User-Defined Scalar Functions (UDSFs), UDAnFs must output a single value for each row of data read and can have no more than 1600 arguments.

Unlike UDSFs, the UDAnF's input reader and output reader can be advanced independently. This feature lets you create UDAnF's where the output value is calculated over multiple rows of data. By advancing the reader and writer independently, you can create functions similar to the built-in analytic functions such as LAG, which uses data from prior rows to output a value for the current row.

In This Section