Vertica::AggregateFunctionFactory Class Reference

Interface for declaring parameters and return types for, and instantiating, an associated AggregateFunction.

Inheritance diagram for Vertica::AggregateFunctionFactory:

Collaboration diagram for Vertica::AggregateFunctionFactory:

Public Types
enum UDXType { SCALAR = 1, TRANSFORM = 2, ANALYTIC = 3, MULTI_TRANSFORM = 4, AGGREGATE = 5, LOAD_SOURCE = 6, LOAD_FILTER = 7, LOAD_PARSER = 8, FILESYSTEM = 9, TYPE = 10, CURSOR_TRANSFORM = 11, KEYMANAGER = 12 }
Public Member Functions
virtual AggregateFunction * createAggregateFunction (ServerInterface &srvInterface)
virtual AggregateFunction * createAggregateFunction (ServerInterface &srvInterface, const SizedColumnTypes &inputType)
virtual void getIntermediateTypes (ServerInterface &srvInterface, const SizedColumnTypes &inputTypes, SizedColumnTypes &intermediateTypeMetaData)=0
virtual void getParameterType (ServerInterface &srvInterface, SizedColumnTypes meterTypes)
virtual void getPerInstanceResources (ServerInterface &srvInterface, VResources &res)
virtual void getPerInstanceResources (ServerInterface &srvInterface, VResources &res, const SizedColumnTypes &inputTypes)
virtual void getPrototype (ServerInterface &srvInterface, ColumnTypes &argTypes, ColumnTypes &returnType)=0
virtual void getReturnType (ServerInterface &srvInterface, const SizedColumnTypes &argTypes, SizedColumnTypes &returnType)=0
Protected Member Functions
virtual UDXType getUDXFactoryType () override
Protected Attributes
Oid libOid
std::string sqlName

Detailed Description

Interface for declaring parameters and return types for, and instantiating, an associated AggregateFunction.

Member Enumeration Documentation

UDXType

enum Vertica::UDXFactory::UDXType

inherited The type of UDX instance this factory produces

Member Function Documentation

createAggregateFunction() [1/2]

virtual AggregateFunction* Vertica::AggregateFunctionFactory::createAggregateFunction(ServerInterface & srvInterface)

inlinevirtual

Called when Vertica needs a new AggregateFunction object to process a function call. Users should override only one of the following methods.

Returns an AggregateFunction 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.

Referenced by createAggregateFunction().

createAggregateFunction() [2/2]

virtual AggregateFunction* Vertica::AggregateFunctionFactory::createAggregateFunction(ServerInterface & srvInterface, const SizedColumnTypes & inputType)

inlinevirtual

Called when Vertica needs a new AggregateFunction object to process a function call. Users should override only one of the following methods.

Returns an AggregateFunction object which implements the UDx API described by this metadata.

Parameters

  • srvInterface: a ServerInterface object used to communicate with Vertica
  • inputType: data type of the input argument

Note More than one object may be instantiated per query.

getIntermediateTypes()

virtual void Vertica::AggregateFunctionFactory::getIntermediateTypes(ServerInterface & srvInterface, const SizedColumnTypes & inputTypes, SizedColumnTypes & intermediateTypeMetaData)

pure virtual Returns the intermediate types used for this aggregate. Called by the server to set the types of the Intermediate aggregates.

getParameterType()

virtual void Vertica::UDXFactory::getParameterType(ServerInterface & srvInterface, SizedColumnTypes & parameterTypes)

inlinevirtualinherited

Function to tell Vertica the name and types of parameters that this function uses. Vertica will use this to warn function callers that certain parameters they provide are not affecting anything, or that certain parameters that are not being set are reverting to default values.

Reimplemented in Vertica::ParserFactory.

getPerInstanceResources() [1/2]

virtual void Vertica::UDXFactory::getPerInstanceResources(ServerInterface & srvInterface, VResources & res)

inlinevirtualinherited

Set the resource required for each instance of the UDX Object subclass. Users should override only one of the following methods.

Parameters

  • srvInterface: a ServerInterface object used to communicate with Vertica
  • res: a VResources object used to tell Vertica what resources are needed by the UDX

Reimplemented in Vertica::UDLFactory.

Referenced by Vertica::UDXFactory::getPerInstanceResources().

getPerInstanceResources() [2/2]

virtual void Vertica::UDXFactory::getPerInstanceResources(ServerInterface & srvInterface, VResources & res, const SizedColumnTypes & inputTypes)

inlinevirtualinherited

Set the resource required for each instance of the UDX Object subclass. Users should override only one of the following methods.

Parameters

  • srvInterface: a ServerInterface object used to communicate with Vertica
  • res: a VResources object used to tell Vertica what resources are needed by the UDX
  • argTypes: Provides the data types of arguments that this UDT was called with

Reimplemented in Vertica::UDLFactory.

getPrototype()

virtual void Vertica::FunctionFactory::getPrototype(ServerInterface & srvInterface, ColumnTypes & argTypes, ColumnTypes & returnType)

pure virtual inherited Provides the argument and return types of the UDX

Implemented in Vertica::MultiPhaseTransformFunctionFactory.

Referenced by Vertica::ScalarFunctionFactory::getReturnType().

getReturnType()

virtual void Vertica::FunctionFactory::getReturnType(ServerInterface & srvInterface, const SizedColumnTypes & argTypes, SizedColumnTypes & returnType)

pure virtual inherited Function to tell Vertica what the return types (and length/precision if necessary) of this UDX 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 UDT was called with. This may be used to modify the return types accordingly.
  • returnType: User code must fill in the names and data types returned by the UDT.

Implemented in Vertica::MultiPhaseTransformFunctionFactory, and Vertica::ScalarFunctionFactory.

getUDXFactoryType()

virtual UDXType Vertica::AggregateFunctionFactory::getUDXFactoryType()

inlineprotectedvirtual

Returns the object type internally used by Vertica

Implements Vertica::UDXFactory.