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). Failing to return a value for a row will result in incorrect results and potentially destabilize the Vertica server if not run in Fenced Mode.

A UDSF cannot have more than 1600 arguments.

In This Section