TransformFunctionFactory class
The TransformFunctionFactory
class tells Vertica metadata about your UDTF: its number of parameters and their data types, as well as the data type of its return value. It also instantiates a subclass of TransformFunction
.
You must implement the following methods in your TransformFunctionFactory
:
-
getPrototype()
returns twoColumnTypes
objects that describe the columns your UDTF takes as input and returns as output. -
getReturnType()
tells Vertica details about the output values: the width of variable-sized data types (such as VARCHAR) and the precision of data types that have settable precision (such as TIMESTAMP). You can also set the names of the output columns using this function. While this method is optional for UDxs that return single values, you must implement it for UDTFs. -
createTransformFunction()
instantiates yourTransformFunction
subclass.
For transform functions written in C++, you can provide information that can help with query optimization. See Improving query performance (C++ only).
API
The TransformFunctionFactory API provides the following methods for extension by subclasses:
The TransformFunctionFactory API provides the following methods for extension by subclasses:
The TransformFunctionFactory API provides the following methods for extension by subclasses:
Implement the Factory function API to define a transform function factory: