Vertica::TransformFunctionPhase Class Reference

Interface to provide compile-time information for a single phase of a multi-phase user-defined transform function.

Collaboration diagram for Vertica::TransformFunctionPhase:

Public Member Functions
virtual TransformFunction * createTransformFunction (ServerInterface &srvInterface)=0
virtual void getReturnType (ServerInterface &srvInterface, const SizedColumnTypes &argTypes, SizedColumnTypes &returnTypes)=0
bool isPrepass ()
void setPrepass ()
Indicates that this phase is a pre-pass (i.e., runs before any data movement)

Detailed Description

Interface to provide compile-time information for a single phase of a multi-phase user-defined transform function.

Note that even though this class shares some methods with TransformFunctionFactory, it is explicitly not a subclass (because it is incorrect to implement a getPrototype() method for this class).

Member Function Documentation

createTransformFunction()

virtual TransformFunction* Vertica::TransformFunctionPhase::createTransformFunction(ServerInterface & srvInterface)

pure virtual Called when Vertica needs a new TransformFunction object to process this phase of a multi-phase UDT.

Returns a TransformFunction object which implements the UDx API described by this metadata.

Parameters

  • srvInterface: a ServerInterface object used to communicate with Vertica

Note More than one object may be instantiated per query.

getReturnType()

virtual void Vertica::TransformFunctionPhase::getReturnType(ServerInterface & srvInterface, const SizedColumnTypes & argTypes, SizedColumnTypes & returnTypes)

pure virtual Function to tell Vertica what the return types (and length/precision if necessary) and partition-by, order-by of this phase are.

For CHAR/VARCHAR types, specify the max length,

For NUMERIC types, specify the precision and scale.

For Time/Timestamp types (with or without time zone), specify the precision, -1 means unspecified/don't care

For IntervalYM/IntervalDS types, specify the precision and range

For all other types, no length/precision specification needed

Parameters

  • argTypes: Provides the data types of arguments that this phase was called with, along with partition and order information. This may be used to modify the return types accordingly.
  • returnTypes: User code must fill in the names and data types returned by this phase, along with the partition-by and order-by column information (if any).