C++ SDK Documentation
23.3.0
|
Produces and initializes UDParsers to parse input into tuples. More...
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 void | getParameterType (ServerInterface &srvInterface, SizedColumnTypes ¶meterTypes) __override__ |
virtual void | getParserReturnType (ServerInterface &srvInterface, PerColumnParamReader &perColumnParamReader, PlanContext &planCtxt, const SizedColumnTypes &argTypes, SizedColumnTypes &returnType) |
virtual void | getPerInstanceResources (ServerInterface &srvInterface, VResources &res) __override__ |
virtual void | getPerInstanceResources (ServerInterface &srvInterface, VResources &res, const SizedColumnTypes &inputTypes) __override__ |
UDXFactory::UDXType | getUDXFactoryType () __override__ |
virtual bool | isChunkerApportionable (ServerInterface &srvInterface) |
virtual bool | isParserApportionable () |
virtual void | plan (ServerInterface &srvInterface, PerColumnParamReader &perColumnParamReader, PlanContext &planCtxt) |
virtual UDParser * | prepare (ServerInterface &srvInterface, PerColumnParamReader &perColumnParamReader, PlanContext &planCtxt, const SizedColumnTypes &returnType)=0 |
virtual UDChunker * | prepareChunker (ServerInterface &srvInterface, PerColumnParamReader &perColumnParamReader, PlanContext &planCtxt, const SizedColumnTypes &returnType) |
Protected Attributes | |
Oid | libOid |
std::string | sqlName |
Produces and initializes UDParsers to parse input into tuples.
Note that ParserFactories are singletons. Subclasses should be stateless, with no fields containing data, just methods. plan() and prepare() methods must never modify any global variables or state; they may only modify the variables that they are given as arguments. (If global state must be modified, use SourceIterator.)
Factories should be registered using the RegisterFactory() macro, defined in Vertica.h.
|
inherited |
The type of UDX instance this factory produces
|
inlinevirtual |
Inherited from the parent "UDXFactory" class in VerticaUDx.h
Reimplemented from Vertica::UDXFactory.
|
inlinevirtual |
Function to tell Vertica what the return types (and length/precision if necessary) of this UDX are. Called, possibly multiple times, on each node executing the query.
The default provided implementation configures Vertica to use the same output column types as the destination table. This requires that the UDParser validate the expected output column types and emit appropriate tuples. Note that the default provided implementation of this function should be sufficient for most Parsers, so this method should not be overridden by most Parser implementations. If a COPY statement has a return type that doesn't match the destination table, Vertica will emit an appropriate error. Users can use COPY expressions to perform typecasting and conversion if necessary.
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
srvInterface | Interface to server operations and functionality, including (not-per-column) parameter lookup |
perColumnParamReader | Per-column parameters passed into the query |
planCtxt | Context for storing and retrieving arbitrary data, for use just by this instance of this query. The same context is shared with plan(). |
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. |
|
inlinevirtualinherited |
Set the resource required for each instance of the UDX Object subclass. Users should override only one of the following methods.
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 from Vertica::UDXFactory.
Referenced by Vertica::UDLFactory::getPerInstanceResources().
|
inlinevirtualinherited |
Set the resource required for each instance of the UDX Object subclass. Users should override only one of the following methods.
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 from Vertica::UDXFactory.
|
inlinevirtual |
Implements Vertica::UDXFactory.
|
inlinevirtual |
Return true if this factory returns a UDChunker that implements alignPortion() and knows what to do with InputState END_OF_PORTION. Such a chunker can start at some offset into a source and chunk just a portion of it.
This does not have to be the same as isParserApportionable() - the two methods can return true/false independent of each other.
|
inlinevirtual |
Return true if this factory returns an UDParser that knows what to do with InputState START_OF_PORTION and END_OF_PORTION. Such a parser can start at some offset into that source and parse just a portion of it
(this func only called by SDK parsers)
|
inlinevirtual |
Execute any planning logic required at query plan time. This method is run once per query, during query initialization. Its job is to perform parameter validation, and to modify the set of nodes that the COPY statement will run on (through srvInterface).
plan() runs exactly once per query, on the initiator node. If it throws an exception, the query will not proceed; it will be aborted prior to distributing the query to the other nodes and running prepare().
srvInterface | Interface to server operations and functionality, including (not-per-column) parameter lookup |
perColumnParamReader | Per-column parameters passed into the query |
planCtxt | Context for storing and retrieving arbitrary data, for use just by this instance of this query. The same context is shared with plan(). |
|
pure virtual |
Instantiate a UDParser instance. This function will be called on each node, prior to the Load operator starting to execute.
'planData' contains the same data that was placed there by the plan() static method.
srvInterface | Interface to server operations and functionality, including (not-per-column) parameter lookup |
perColumnParamReader | Per-column parameters passed into the query |
planCtxt | Context for storing and retrieving arbitrary data, for use just by this instance of this query. The same context is shared with plan(). |
returnType | The data types of the columns that this Parser must produce |