Interface for User-Defined Aggregate Function (UDAF). A UDAF operates on one column of data and returns one column of data.
More...
|
virtual void | aggregateArrs (ServerInterface &srvInterface, void **dstTuples, int doff, const void *arr, int stride, const void *rcounts, int rcstride, int count, IntermediateAggs &intAggs, std::vector< int > &intOffsets, BlockReader &arg_reader)=0 |
|
void | cancelUDX (ServerInterface &srvInterface) |
|
virtual void | combine (ServerInterface &srvInterface, IntermediateAggs &aggs_output, MultipleIntermediateAggs &aggs_other)=0 |
|
virtual void | destroy (ServerInterface &srvInterface, const SizedColumnTypes &argTypes) |
|
virtual void | destroy (ServerInterface &srvInterface, const SizedColumnTypes &argTypes, SessionParamWriterMap &udSessionParams) |
|
virtual void | initAggregate (ServerInterface &srvInterface, IntermediateAggs &aggs)=0 |
|
bool | isCanceled () const |
|
virtual void | setup (ServerInterface &srvInterface, const SizedColumnTypes &argTypes) |
|
virtual void | terminate (ServerInterface &srvInterface, BlockWriter &res_writer, IntermediateAggs &aggs) |
|
virtual void | terminate (ServerInterface &srvInterface, BlockWriter &res_writer, IntermediateAggs &aggs, SessionParamWriterMap &udSessionParams) |
|
Interface for User-Defined Aggregate Function (UDAF). A UDAF operates on one column of data and returns one column of data.
An AggregateFunction must have an associated AggregateFunctionFactory.
◆ aggregateArrs()
virtual void Vertica::AggregateFunction::aggregateArrs |
( |
ServerInterface & |
srvInterface, |
|
|
void ** |
dstTuples, |
|
|
int |
doff, |
|
|
const void * |
arr, |
|
|
int |
stride, |
|
|
const void * |
rcounts, |
|
|
int |
rcstride, |
|
|
int |
count, |
|
|
IntermediateAggs & |
intAggs, |
|
|
std::vector< int > & |
intOffsets, |
|
|
BlockReader & |
arg_reader |
|
) |
| |
|
pure virtual |
Called by the server to perform aggregation on multiple blocks of data
- Note
- User should not explicity implement this function. It is implemented by calling the InlineAggregate() macro. User should follow the convention of implementing void aggregate(ServerInterface &srvInterface, BlockReader &arg_reader, IntermediateAggs &aggs) along with initAggregate, combine, and terminate. For references on what a fully implemented Aggregate Function looks like, check the examples in the example folder.
which the inlined aggregateArrs implemention will invoke
◆ cancel()
|
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().
◆ cancelUDX()
Cancel callback invoked when the query running the UDX has been canceled. See cancel().
◆ combine()
Called when intermediate aggregates need to be combined with each other
◆ destroy() [1/2]
◆ destroy() [2/2]
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
◆ initAggregate()
Called by the server to set the starting values of the Intermediate aggregates.
- Note
- This can be called multiple times on multiple machines, so starting values should be idempotent.
◆ isCanceled()
bool Vertica::UDXObject::isCanceled |
( |
| ) |
const |
|
inlineinherited |
- Returns
- true iff this UDX has been canceled
◆ setup()
Perform per instance initialization. This function may throw errors.
◆ terminate() [1/2]
Called by the server to get the output to the aggregate function
Referenced by terminate().
◆ terminate() [2/2]
Called by the server to get the output to the aggregate function
◆ updateCols()
void Vertica::AggregateFunction::updateCols |
( |
BlockReader & |
arg_reader, |
|
|
char * |
arg, |
|
|
int |
count, |
|
|
IntermediateAggs & |
intAggs, |
|
|
char * |
aggPtr, |
|
|
std::vector< int > & |
intOffsets |
|
) |
| |
|
static |
Helper function for aggregateArrs.
- Note
- User should not call this function.