C++ SDK Documentation  23.4.0
Vertica.h File Reference

Contains the classes needed to write User-Defined things in Vertica. More...

Include dependency graph for Vertica.h:

Classes

struct  Vertica::LibraryRegistrar
 
struct  Vertica::UDxRegistrar
 

Namespaces

 Vertica
 

Macros

#define InlineAggregate()
 
#define RegisterFactory(clazz)
 
#define RegisterLibrary(author, library_build_tag, library_version, library_sdk_version, source_url, description, licenses_required, signature)   Vertica::LibraryRegistrar registrar(author, library_build_tag, library_version, library_sdk_version, source_url, description, licenses_required, signature)
 

Detailed Description

Contains the classes needed to write User-Defined things in Vertica.

Macro Definition Documentation

#define InlineAggregate ( )
Value:
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) override {\
char *arg = const_cast<char*>(static_cast<const char*>(arr));\
const uint8 *rowCountPtr = static_cast<const uint8*>(rcounts);\
for (int i=0; i<count; ++i) {\
vpos rowCount = *reinterpret_cast<const vpos*>(rowCountPtr);\
char *aggPtr = static_cast<char *>(dstTuples[i]) + doff;\
updateCols(arg_reader, arg, rowCount, intAggs, aggPtr, intOffsets);\
aggregate(srvInterface, arg_reader, intAggs);\
arg += rowCount * stride;\
rowCountPtr += rcstride;\
}\
}\
unsigned long long vpos
64-bit vertica position
Definition: BasicsUDxShared.h:103
unsigned char uint8
unsigned 8-bit integer
Definition: BasicsUDxShared.h:73

InlineAggregate() is used to implement the virtual function "aggregateArrs()" for AggregateFunctions. This allows aggregate functions to work on blocks at a time. This macro should be called from inside an AggregateFunction - for a reference, check the examples in the example folder.

#define RegisterFactory (   clazz)
Value:
clazz clazz##_instance; \
extern "C" Vertica::UDXFactory *get##clazz() { return &clazz##_instance; } \
Vertica::UDxRegistrar clazz##_registrar(#clazz)
Parent class for UDx factories; not intended for direct use by applications.
Definition: VerticaUDx.h:3151
Parameters
classThe name of the class to register as a UDx factory. Helper macro for registering UDx's with Vertica

To use: Extend a subclass of UDXFactory (e.g. ScalarFunctionFactory) and then call RegisterFactory with that class name.

For example:

... class MyFactory : public ScalarFunctionFactory ...

RegisterFactory(MyFactory);