C++ SDK Documentation
12.0.0
|
An ExecutorParamWriter is a ParamWriter whose scope is limited to a single executor node - it will never be serialized for transfer to a different node. As a result, any object which is allocated from a Vertica memory pool (i.e. a ServerInterface's allocator object) can have its address saved in the ExecutorParamWriter (see setPointer()), and be safely retrieved later on (see getPointer()) from a different API call in the same query. More...
Public Member Functions | |
ExecutorParamWriter (VTAllocator *allocator=NULL) | |
void | addParameter (std::string paramName, const char *arg, const VerticaType &dt) |
void | clearParameter (std::string fieldName) |
bool | containsParameter (std::string paramName) const |
Function to see if the ParamReader has a value for the parameter. | |
void | copy (const VerticaBlock &other) |
void | copy (const ParamReader &other) |
Copy the other ParamReader. Discard any existing parameters TODO: create an alternate version that only copies if this ParamReader is empty, is a no-op if they are non-empty and the same, and error if they are non-empty and different. | |
const vbool * | getBoolPtr (std::string paramName) const |
Get a pointer to a BOOLEAN value from the input row. More... | |
const vbool & | getBoolRef (std::string paramName) const |
Get a reference to a BOOLEAN value from the input row. More... | |
template<class T > | |
const T * | getColPtr (size_t idx) const |
template<> | |
const VString * | getColPtr (size_t idx) const |
template<> | |
const VNumeric * | getColPtr (size_t idx) const |
template<> | |
const VUuid * | getColPtr (size_t idx) const |
template<> | |
const BlockReader * | getColPtr (size_t idx) const |
template<class T > | |
T * | getColPtrForWrite (size_t idx) |
template<> | |
VString * | getColPtrForWrite (size_t idx) |
template<> | |
VNumeric * | getColPtrForWrite (size_t idx) |
template<> | |
VUuid * | getColPtrForWrite (size_t idx) |
template<> | |
BlockWriter * | getColPtrForWrite (size_t idx) |
template<class T > | |
const T & | getColRef (size_t idx) const |
template<class T > | |
T & | getColRefForWrite (size_t idx) |
int | getColStride (size_t idx) const |
const EE::DataArea * | getDataArea (size_t idx) const |
const DateADT * | getDatePtr (std::string paramName) const |
Get a pointer to a DATE value from the input row. More... | |
const DateADT & | getDateRef (std::string paramName) const |
Get a reference to a DATE value from the input row. More... | |
const vfloat * | getFloatPtr (std::string paramName) const |
Get a pointer to a FLOAT value from the input row. More... | |
const vfloat & | getFloatRef (std::string paramName) const |
Get a reference to a FLOAT value from the input row. More... | |
size_t | getIndex (std::string paramName) const |
const Interval * | getIntervalPtr (std::string paramName) const |
Get a pointer to an INTERVAL value from the input row. More... | |
const Interval & | getIntervalRef (std::string paramName) const |
Get a reference to an INTERVAL value from the input row. More... | |
const IntervalYM * | getIntervalYMPtr (std::string paramName) const |
Get a pointer to a INTERVAL YEAR TO MONTH value from the input row. More... | |
const IntervalYM & | getIntervalYMRef (std::string paramName) const |
Get a reference to an INTERVAL YEAR TO MONTH value from the input row. More... | |
const vint * | getIntPtr (std::string paramName) const |
Get a pointer to an INTEGER value from the input row. More... | |
const vint & | getIntRef (std::string paramName) const |
Get a reference to an INTEGER value from the input row. More... | |
VString & | getLongStringRef (std::string fieldName) |
Allocates a new VString object to use as output. Sets it to be a 32mb LONG type by default. More... | |
size_t | getNumCols () const |
const VNumeric * | getNumericPtr (std::string paramName) const |
Get a pointer to a VNumeric value from the input row. More... | |
const VNumeric & | getNumericRef (std::string paramName) const |
Get a reference to a VNumeric value from the input row. More... | |
VNumeric & | getNumericRef (std::string fieldName) |
Allocate a new VNumeric object to use as output. More... | |
int | getNumRows () const |
std::vector< std::string > | getParamNames () const |
Return the names of all parameters stored in this ParamReader. | |
template<class T > | |
T * | getPointer (std::string fieldName) const |
const VString * | getStringPtr (std::string paramName) const |
Get a pointer to a VString value from the input row. More... | |
const VString & | getStringRef (std::string paramName) const |
Get a reference to an VString value from the input row. More... | |
VString & | getStringRef (std::string fieldName) |
Allocates a new VString object to use as output. More... | |
const TimeADT * | getTimePtr (std::string paramName) const |
Get a pointer to a TIME value from the input row. More... | |
const TimeADT & | getTimeRef (std::string paramName) const |
Get a reference to a TIME value from the input row. More... | |
const Timestamp * | getTimestampPtr (std::string paramName) const |
Get a pointer to a TIMESTAMP value from the input row. More... | |
const Timestamp & | getTimestampRef (std::string paramName) const |
Get a reference to a TIMESTAMP value from the input row. More... | |
const TimestampTz * | getTimestampTzPtr (std::string paramName) const |
Get a pointer to a TIMESTAMP WITH TIMEZONE value from the input row. More... | |
const TimestampTz & | getTimestampTzRef (std::string paramName) const |
Get a reference to a TIMESTAMP WITH TIMEZONE value from the input row. More... | |
const TimeTzADT * | getTimeTzPtr (std::string paramName) const |
Get a pointer to a TIME WITH TIMEZONE value from the input row. More... | |
const TimeTzADT & | getTimeTzRef (std::string paramName) const |
Get a reference to a TIME WITH TIMEZONE value from the input row. More... | |
VerticaType | getType (std::string paramName) const |
Return the type of the given parameter. | |
const SizedColumnTypes & | getTypeMetaData () const |
SizedColumnTypes & | getTypeMetaData () |
VUuid * | getUuidPtr (std::string paramName) const |
Get a pointer to a VUuid value from the input row. More... | |
const VUuid & | getUuidRef (std::string paramName) const |
VUuid & | getUuidRef (std::string fieldName) |
Allocate a new VUuid object to use as output. More... | |
void * | getVoidPtr (size_t idx=0) |
const void * | getVoidPtr (size_t idx=0) const |
bool | isEmpty () const |
Returns true if there are no parameters. | |
bool | remaining () const |
void | setAllocator (VTAllocator *allocator) |
Sets the allocator to be used to allocate variable size param values such as VString. Given allocator live longer than this ParamWriter. More... | |
void | setBool (std::string fieldName, vbool r) |
Adds a BOOLEAN value to the output row. More... | |
void | setDataArea (size_t idx, void *dataarea) |
void | setDate (std::string fieldName, DateADT r) |
Adds a BOOLEAN value to the output row. More... | |
void | setFloat (std::string fieldName, vfloat r) |
Adds a FLOAT value to the output row. More... | |
void | setInt (std::string fieldName, vint r) |
Adds an INTEGER value to the output row. More... | |
void | setInterval (std::string fieldName, Interval r, int32 precision, int32 range) |
Adds an INTERVAL value to the output row. More... | |
void | setIntervalYM (std::string fieldName, IntervalYM r, int32 range) |
Adds an INTERVAL YEAR TO MONTH value to the output row. More... | |
template<class T > | |
void | setPointer (std::string fieldName, T *ptr) |
void | setTime (std::string fieldName, TimeADT r, int32 precision) |
Adds a TIME value to the output row. More... | |
void | setTimestamp (std::string fieldName, Timestamp r, int32 precision) |
Adds a TIMESTAMP value to the output row. More... | |
void | setTimestampTz (std::string fieldName, TimestampTz r, int32 precision) |
Adds a TIMESTAMP WITH TIMEZONE value to the output row. More... | |
void | setTimeTz (std::string fieldName, TimeTzADT r, int32 precision) |
Adds a TIME WITH TIMEZONE value to the output row. More... | |
Public Attributes | |
std::map< std::string, size_t > | paramNameToIndex |
Protected Member Functions | |
void | addCol (char *arg, int colstride, const Field &field) |
void | addCol (const char *arg, int colstride, const Field &field) |
bool | checkStringUserBlockInfo (size_t idx) const |
bool | checkTimeUserBlockInfo (size_t idx) const |
EE::DataArea ** | getArrayIntermediateDataArea (size_t c) |
void | reset () |
void | resetIndex () |
void | setRowCount (int rowCount) |
void | validateStringColumn (size_t idx, const VString &s, size_t colLength) const |
Protected Attributes | |
std::vector< char * > | cols |
std::vector< int > | colstrides |
int | count |
std::vector< NestedBlockPtr > | ctWrappers |
int | index |
const int * | indices |
size_t | ncols |
int | nrows |
std::vector< BaseDataOID > | processBlockUserInfoVector |
std::vector< VString > | svWrappers |
SizedColumnTypes | typeMetaData |
std::vector< VUuid > | uuWrappers |
std::vector< VNumeric > | vnWrappers |
An ExecutorParamWriter is a ParamWriter whose scope is limited to a single executor node - it will never be serialized for transfer to a different node. As a result, any object which is allocated from a Vertica memory pool (i.e. a ServerInterface's allocator object) can have its address saved in the ExecutorParamWriter (see setPointer()), and be safely retrieved later on (see getPointer()) from a different API call in the same query.
|
protectedinherited |
Add the location for reading a particular argument.
arg | The base location to find data. |
colstride | The stride between data instances. |
field | metadata for the added column |
dt | The type of input. |
fieldname | the name of the field |
Referenced by Vertica::ParamReader::addParameter().
|
inlineinherited |
Add a parameter to the block and stores it name and corresponding index in the paramNameToIndex map
|
inlineprotectedinherited |
|
inlineinherited |
Get a pointer to a BOOLEAN value from the input row.
paramName | The name of the parameter to retrieve |
Referenced by Vertica::ParamReader::getBoolRef().
|
inlineinherited |
Get a reference to a BOOLEAN value from the input row.
paramName | The name of the parameter to retrieve |
|
inlineinherited |
|
inlineinherited |
Example: const vint a = arg_reader->getColRef<vint>(0);
|
inlineinherited |
Get a pointer to a DATE value from the input row.
paramName | The name of the parameter to retrieve |
Referenced by Vertica::ParamReader::getDateRef().
|
inlineinherited |
Get a reference to a DATE value from the input row.
paramName | The name of the parameter to retrieve |
|
inlineinherited |
Get a pointer to a FLOAT value from the input row.
paramName | The name of the parameter to retrieve |
Referenced by Vertica::ParamReader::getFloatRef().
|
inlineinherited |
Get a reference to a FLOAT value from the input row.
paramName | The name of the parameter to retrieve |
|
inlineinherited |
Get a pointer to an INTERVAL value from the input row.
paramName | The name of the parameter to retrieve |
Referenced by Vertica::ParamReader::getIntervalRef().
|
inlineinherited |
Get a reference to an INTERVAL value from the input row.
paramName | The name of the parameter to retrieve |
|
inlineinherited |
Get a pointer to a INTERVAL YEAR TO MONTH value from the input row.
paramName | The name of the parameter to retrieve |
Referenced by Vertica::ParamReader::getIntervalYMRef().
|
inlineinherited |
Get a reference to an INTERVAL YEAR TO MONTH value from the input row.
paramName | The name of the parameter to retrieve |
|
inlineinherited |
Get a pointer to an INTEGER value from the input row.
paramName | The name of the parameter to retrieve |
Example:
Referenced by Vertica::ParamReader::getIntRef().
|
inlineinherited |
Get a reference to an INTEGER value from the input row.
paramName | The name of the parameter to retrieve |
Example:
|
inlineinherited |
|
inlineinherited |
Referenced by Vertica::BlockWriter::copyFromInput(), Vertica::BlockReader::isNull(), and Vertica::BlockWriter::setNull().
|
inlineinherited |
Get a pointer to a VNumeric value from the input row.
paramName | The name of the parameter to retrieve |
Referenced by Vertica::ParamReader::getNumericRef().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Get a pointer to a VString value from the input row.
paramName | The name of the parameter to retrieve |
Referenced by Vertica::ParamReader::getStringRef().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Get a pointer to a TIME value from the input row.
paramName | The name of the parameter to retrieve |
Referenced by Vertica::ParamReader::getTimeRef().
|
inlineinherited |
Get a reference to a TIME value from the input row.
paramName | The name of the parameter to retrieve |
|
inlineinherited |
Get a pointer to a TIMESTAMP value from the input row.
paramName | The name of the parameter to retrieve |
Referenced by Vertica::ParamReader::getTimestampRef().
|
inlineinherited |
Get a reference to a TIMESTAMP value from the input row.
paramName | The name of the parameter to retrieve |
|
inlineinherited |
Get a pointer to a TIMESTAMP WITH TIMEZONE value from the input row.
paramName | The name of the parameter to retrieve |
Referenced by Vertica::ParamReader::getTimestampTzRef().
|
inlineinherited |
Get a reference to a TIMESTAMP WITH TIMEZONE value from the input row.
paramName | The name of the parameter to retrieve |
|
inlineinherited |
Get a pointer to a TIME WITH TIMEZONE value from the input row.
paramName | The name of the parameter to retrieve |
Referenced by Vertica::ParamReader::getTimeTzRef().
|
inlineinherited |
Get a reference to a TIME WITH TIMEZONE value from the input row.
paramName | The name of the parameter to retrieve |
|
inlineinherited |
Referenced by Vertica::ParamReader::getType(), Vertica::BlockReader::isNull(), and Vertica::BlockWriter::setNull().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Sets the allocator to be used to allocate variable size param values such as VString. Given allocator live longer than this ParamWriter.
allocator | Used to allocate param values. |
|
inlineinherited |
Adds a BOOLEAN value to the output row.
r | The BOOLEAN value to insert into the output row. |
|
inlineinherited |
Adds a BOOLEAN value to the output row.
r | The BOOLEAN value to insert into the output row. |
|
inlineinherited |
Adds a FLOAT value to the output row.
r | The FLOAT value to insert into the output row. |
|
inlineinherited |
Adds an INTEGER value to the output row.
Setter methods
r | The INTEGER value to insert into the output row. |
|
inlineinherited |
Adds an INTERVAL value to the output row.
r | The INTERVAL value to insert into the output row. |
|
inlineinherited |
Adds an INTERVAL YEAR TO MONTH value to the output row.
r | The INTERVAL YEAR TO MONTH value to insert into the output row. |
|
inlineinherited |
Adds a TIME value to the output row.
r | The TIME value to insert into the output row. |
|
inlineinherited |
Adds a TIMESTAMP value to the output row.
r | The TIMESTAMP value to insert into the output row. |
|
inlineinherited |
Adds a TIMESTAMP WITH TIMEZONE value to the output row.
r | The TIMESTAMP WITH TIMEZONE value to insert into the output row. |
|
inlineinherited |
Adds a TIME WITH TIMEZONE value to the output row.
r | The TIME WITH TIMEZONE value to insert into the output row. |
|
inherited |
Bookkeepinp to make a parameter and its position in the block
Referenced by Vertica::ParamReader::addParameter(), Vertica::ParamReader::containsParameter(), Vertica::ParamReader::copy(), Vertica::ParamWriter::getLongStringRef(), Vertica::ParamWriter::getNumericRef(), Vertica::ParamReader::getParamNames(), Vertica::ParamWriter::getStringRef(), Vertica::ParamWriter::getUuidRef(), and Vertica::ParamReader::isEmpty().