Java SDK Documentation  8.1
com.vertica.sdk.ScalarFunction Class Referenceabstract

Interface for User-Defined Scalar Function (UDSF). A UDSF produces a single value from a row of data. More...

Inheritance diagram for com.vertica.sdk.ScalarFunction:
Inheritance graph
Collaboration diagram for com.vertica.sdk.ScalarFunction:
Collaboration graph

Classes

enum  InterfaceType
 

Public Member Functions

void destroy (ServerInterface srvInterface, SizedColumnTypes argTypes)
 
void destroy (ServerInterface srvInterface, SizedColumnTypes argTypes, SessionParamWriterMap udSessionParams)
 
abstract void processBlock (ServerInterface srvInterface, BlockReader arg_reader, BlockWriter res_writer) throws UdfException, DestroyInvocation
 
void setup (ServerInterface srvInterface, SizedColumnTypes argTypes)
 

Protected Member Functions

InterfaceType getInterfaceType ()
 

Detailed Description

Interface for User-Defined Scalar Function (UDSF). A UDSF produces a single value from a row of data.

A UDSF can be used anywhere a native function can be used, except CREATE TABLE BY PARTITION and SEGMENTED BY expressions.

A ScalarFunction must have an associated ScalarFunctionFactory.

Member Function Documentation

void com.vertica.sdk.UDXObject.destroy ( ServerInterface  srvInterface,
SizedColumnTypes  argTypes 
)
inherited

Perform per instance destruction. This function may throw errors

Referenced by com.vertica.sdk.UDXObject.destroy().

void com.vertica.sdk.UDXObject.destroy ( ServerInterface  srvInterface,
SizedColumnTypes  argTypes,
SessionParamWriterMap  udSessionParams 
)
inherited

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

abstract void com.vertica.sdk.ScalarFunction.processBlock ( ServerInterface  srvInterface,
BlockReader  arg_reader,
BlockWriter  res_writer 
) throws UdfException, DestroyInvocation
abstract

Invoke a user defined function 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
arg_readerinput rows
res_writeroutput location
Note
  • This methods may be invoked by different threads at different times, and by a different thread than the constructor.
  • The order in which the function sees rows is not guaranteed.
void com.vertica.sdk.UDXObject.setup ( ServerInterface  srvInterface,
SizedColumnTypes  argTypes 
)
inherited

Perform per instance initialization. This function may throw errors.