C++ SDK Documentation  12.0.3
Vertica::TransformFunction Class Referenceabstract

Interface for User-Defined Transform Function (UDTF). A UDTF operates on a table segment and returns zero or more rows of data. More...

Inheritance diagram for Vertica::TransformFunction:
Inheritance graph
Collaboration diagram for Vertica::TransformFunction:
Collaboration graph

Public Member Functions

void cancelUDX (ServerInterface &srvInterface)
 
virtual void destroy (ServerInterface &srvInterface, const SizedColumnTypes &argTypes)
 
virtual void destroy (ServerInterface &srvInterface, const SizedColumnTypes &argTypes, SessionParamWriterMap &udSessionParams)
 
bool isCanceled () const
 
virtual void processPartition (ServerInterface &srvInterface, PartitionReader &input_reader, PartitionWriter &output_writer)=0
 
virtual void setup (ServerInterface &srvInterface, const SizedColumnTypes &argTypes)
 

Protected Member Functions

virtual void cancel (ServerInterface &srvInterface)
 

Detailed Description

Interface for User-Defined Transform Function (UDTF). A UDTF operates on a table segment and returns zero or more rows of data.

UDTFs can only be used in the SELECT list of a query. UDTFs are cancelable.

A TransformFunction must have an associated TransformFunctionFactory.

Member Function Documentation

virtual void Vertica::UDXObject::cancel ( ServerInterface srvInterface)
inlineprotectedvirtualinherited

Cancel callback to be overridden by the UDX. Called when the query running the UDX has been canceled.

Note
  • This method will be invoked at most once per UDX object. Once a UDX object has been canceled, it will never be un-canceled.
  • This method may be called from a separate thread, concurrently with other methods of this UDX object (but never the constructor or destructor). Implementations must be thread-safe with all methods of this UDX.
  • This method will be invoked for either an explicit user cancel, or in the event of an error during query execution.

Referenced by Vertica::UDXObject::cancelUDX().

void Vertica::UDXObject::cancelUDX ( ServerInterface srvInterface)
inlineinherited

Cancel callback invoked when the query running the UDX has been canceled. See cancel().

virtual void Vertica::UDXFunction::destroy ( ServerInterface srvInterface,
const SizedColumnTypes argTypes 
)
inlinevirtualinherited

Perform per instance destruction. This function may throw errors

Referenced by Vertica::UDXFunction::destroy().

virtual void Vertica::UDXFunction::destroy ( ServerInterface srvInterface,
const SizedColumnTypes argTypes,
SessionParamWriterMap udSessionParams 
)
inlinevirtualinherited

Perform per instance destruction and write session parameters to be used by UDxs that are invoked after this one returns. This function may throw errors

bool Vertica::UDXObject::isCanceled ( ) const
inlineinherited
Returns
true iff this UDX has been canceled
virtual void Vertica::TransformFunction::processPartition ( ServerInterface srvInterface,
PartitionReader input_reader,
PartitionWriter output_writer 
)
pure virtual

Invoke a user defined transform on a set of rows. As the name suggests, a batch of rows are passed in for every invocation to amortize performance.

Parameters
srvInterfacea ServerInterface object used to communicate with Vertica
input_readerinput rows
output_writeroutput location
virtual void Vertica::UDXFunction::setup ( ServerInterface srvInterface,
const SizedColumnTypes argTypes 
)
inlinevirtualinherited

Perform per instance initialization. This function may throw errors.