Scalar Functions (UDSFs)

A user-defined scalar function (UDSF) returns a single value for each row of data it reads. You can use a UDSF anywhere you can use a built-in Vertica function. You usually develop a UDSF to perform data manipulations that are too complex or too slow to perform using SQL statements and functions. UDSFs also let you use analytic functions provided by third-party libraries within Vertica while still maintaining high performance.

Your UDSF must return a value for every input row (unless it generates an error; see Handling Errors for details). Failure to return a value for a row results in incorrect results and potentially destabilizes the Vertica server if not run in Fenced Mode.

A UDSF cannot have more than 1600 arguments.

In This Section