Vertica::ExecutorParamWriter Class Reference
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.
Inheritance diagram for Vertica::ExecutorParamWriter:
Collaboration diagram for Vertica::ExecutorParamWriter:
| 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. | |
| const vbool & | getBoolRef (std::string paramName) const |
| Get a reference to a BOOLEAN value from the input row. | |
| template | |
| 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 | |
| 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 | |
| const T & | getColRef (size_t idx) const |
| template | |
| 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. | |
| const DateADT & | getDateRef (std::string paramName) const |
| Get a reference to a DATE value from the input row. | |
| const vfloat * | getFloatPtr (std::string paramName) const |
| Get a pointer to a FLOAT value from the input row. | |
| const vfloat & | getFloatRef (std::string paramName) const |
| Get a reference to a FLOAT value from the input row. | |
| 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. | |
| const Interval & | getIntervalRef (std::string paramName) const |
| Get a reference to an INTERVAL value from the input row. | |
| const IntervalYM * | getIntervalYMPtr (std::string paramName) const |
| Get a pointer to a INTERVAL YEAR TO MONTH value from the input row. | |
| const IntervalYM & | getIntervalYMRef (std::string paramName) const |
| Get a reference to an INTERVAL YEAR TO MONTH value from the input row. | |
| const vint * | getIntPtr (std::string paramName) const |
| Get a pointer to an INTEGER value from the input row. | |
| const vint & | getIntRef (std::string paramName) const |
| Get a reference to an INTEGER value from the input row. | |
| VString & | getLongStringRef (std::string fieldName) |
| Allocates a new VString object to use as output. Sets it to be a 32mb LONG type by default. | |
| size_t | getNumCols () const |
| const VNumeric * | getNumericPtr (std::string paramName) const |
| Get a pointer to a VNumeric value from the input row. | |
| const VNumeric & | getNumericRef (std::string paramName) const |
| Get a reference to a VNumeric value from the input row. | |
| VNumeric & | getNumericRef (std::string fieldName) |
| Allocate a new VNumeric object to use as output. | |
| int | getNumRows () const |
| std::vector | getParamNames () const |
| Return the names of all parameters stored in this ParamReader. | |
| template | |
| T * | getPointer (std::string fieldName) const |
| const VString * | getStringPtr (std::string paramName) const |
| Get a pointer to a VString value from the input row. | |
| const VString & | getStringRef (std::string paramName) const |
| Get a reference to an VString value from the input row. | |
| VString & | getStringRef (std::string fieldName) |
| Allocates a new VString object to use as output. | |
| const TimeADT * | getTimePtr (std::string paramName) const |
| Get a pointer to a TIME value from the input row. | |
| const TimeADT & | getTimeRef (std::string paramName) const |
| Get a reference to a TIME value from the input row. | |
| const Timestamp * | getTimestampPtr (std::string paramName) const |
| Get a pointer to a TIMESTAMP value from the input row. | |
| const Timestamp & | getTimestampRef (std::string paramName) const |
| Get a reference to a TIMESTAMP value from the input row. | |
| const TimestampTz * | getTimestampTzPtr (std::string paramName) const |
| Get a pointer to a TIMESTAMP WITH TIMEZONE value from the input row. | |
| const TimestampTz & | getTimestampTzRef (std::string paramName) const |
| Get a reference to a TIMESTAMP WITH TIMEZONE value from the input row. | |
| const TimeTzADT * | getTimeTzPtr (std::string paramName) const |
| Get a pointer to a TIME WITH TIMEZONE value from the input row. | |
| const TimeTzADT & | getTimeTzRef (std::string paramName) const |
| Get a reference to a TIME WITH TIMEZONE value from the input row. | |
| 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. | |
| const VUuid & | getUuidRef (std::string paramName) const |
| VUuid & | getUuidRef (std::string fieldName) |
| Allocate a new VUuid object to use as output. | |
| 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. | |
| void | setBool (std::string fieldName, vbool r) |
| Adds a BOOLEAN value to the output row. | |
| void | setDataArea (size_t idx, void *dataarea) |
| void | setDate (std::string fieldName, DateADT r) |
| Adds a BOOLEAN value to the output row. | |
| void | setFloat (std::string fieldName, vfloat r) |
| Adds a FLOAT value to the output row. | |
| void | setInt (std::string fieldName, vint r) |
| Adds an INTEGER value to the output row. | |
| void | setInterval (std::string fieldName, Interval r, int32 precision, int32 range) |
| Adds an INTERVAL value to the output row. | |
| void | setIntervalYM (std::string fieldName, IntervalYM r, int32 range) |
| Adds an INTERVAL YEAR TO MONTH value to the output row. | |
| template | |
| void | setPointer (std::string fieldName, T *ptr) |
| void | setTime (std::string fieldName, TimeADT r, int32 precision) |
| Adds a TIME value to the output row. | |
| void | setTimestamp (std::string fieldName, Timestamp r, int32 precision) |
| Adds a TIMESTAMP value to the output row. | |
| void | setTimestampTz (std::string fieldName, TimestampTz r, int32 precision) |
| Adds a TIMESTAMP WITH TIMEZONE value to the output row. | |
| void | setTimeTz (std::string fieldName, TimeTzADT r, int32 precision) |
| Adds a TIME WITH TIMEZONE value to the output row. |
| Public Attributes | |
|---|---|
| std::map | 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 | cols |
| std::vector | colstrides |
| int | count |
| std::vector | ctWrappers |
| int | index |
| const int * | indices |
| size_t | ncols |
| int | nrows |
| std::vector | processBlockUserInfoVector |
| std::vector | svWrappers |
| SizedColumnTypes | typeMetaData |
| std::vector | uuWrappers |
| std::vector | vnWrappers |
Detailed Description
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.
Member Function Documentation
void Vertica::VerticaBlock::addCol(char * arg, int colstride, const Field & field)
protected inherited Add the location for reading a particular argument.
Parameters
arg: The base location to find data.colstride: The stride between data instances.field: metadata for the added columndt: The type of input.fieldname: the name of the field
Referenced by Vertica::ParamReader::addParameter().
void Vertica::ParamReader::addParameter(std::string paramName, const char * arg, const VerticaType & dt)
inline inherited Add a parameter to the block and stores it name and corresponding index in the paramNameToIndex map
EE::DataArea** Vertica::VerticaBlock::getArrayIntermediateDataArea(size_t c)
inlineprotectedinherited
Returns a pointer to a DataArea for accumulating an intermediate result
const vbool* Vertica::ParamReader::getBoolPtr(std::string paramName) const
inline inherited Get a pointer to a BOOLEAN value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns A pointer to the retrieved value cast as a BOOLEAN.
Referenced by Vertica::ParamReader::getBoolRef().
const vbool& Vertica::ParamReader::getBoolRef(std::string paramName) const
inline inherited Get a reference to a BOOLEAN value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns a reference to the parameter value, cast as an BOOLEAN.
template<class T >
const T* Vertica::VerticaBlock::getColPtr(size_t idx) const
inline inherited Returns a pointer to the idx'th argument, cast appropriately.
Example:
const vint *a = arg_reader->getColPtr(0);
template<class T >
const T& Vertica::VerticaBlock::getColRef(size_t idx) const
inline inherited Returns a pointer to the idx'th argument, cast appropriately.
Example
const vint a = arg_reader->getColRef<vint>(0);
const DateADT* Vertica::ParamReader::getDatePtr(std::string paramName) const
inline inherited Get a pointer to a DATE value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns A pointer to the retrieved value cast as a DATE.
Referenced by Vertica::ParamReader::getDateRef().
const DateADT& Vertica::ParamReader::getDateRef(std::string paramName) const
inline inherited Get a reference to a DATE value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns a reference to the parameter value, cast as an DATE.
const vfloat* Vertica::ParamReader::getFloatPtr(std::string paramName) const
inline inherited Get a pointer to a FLOAT value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns A pointer to the retrieved value cast as a FLOAT.
Referenced by Vertica::ParamReader::getFloatRef().
const vfloat& Vertica::ParamReader::getFloatRef(std::string paramName) const
inline inherited Get a reference to a FLOAT value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns A reference to the parameter value, cast as an FLOAT.
const Interval* Vertica::ParamReader::getIntervalPtr(std::string paramName) const
inline inherited Get a pointer to an INTERVAL value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns A pointer to the retrieved value cast as an INTERVAL.
Referenced by Vertica::ParamReader::getIntervalRef().
const Interval& Vertica::ParamReader::getIntervalRef(std::string paramName) const
inline inherited Get a reference to an INTERVAL value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns a reference to the parameter value, cast as an INTERVAL.
const IntervalYM* Vertica::ParamReader::getIntervalYMPtr(std::string paramName) const
inline inherited Get a pointer to a INTERVAL YEAR TO MONTH value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns A point to the retrieved value cast as a INTERVAL YEAR TO MONTH.
Referenced by Vertica::ParamReader::getIntervalYMRef().
const IntervalYM& Vertica::ParamReader::getIntervalYMRef(std::string paramName) const
inline inherited Get a reference to an INTERVAL YEAR TO MONTH value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns a reference to the parameter value, cast as an INTERVAL YEAR TO MONTH.
const vint* Vertica::ParamReader::getIntPtr(std::string paramName) const
inline inherited Get a pointer to an INTEGER value from the input row.
Returns a pointer to the idx'th argument, cast appropriately.
Parameters
paramName: The name of the parameter to retrieve
Example:
vint *a = arg_reader->getIntPtr("max");
Referenced by Vertica::ParamReader::getIntRef().
const vint& Vertica::ParamReader::getIntRef(std::string paramName) const
inline inherited Get a reference to an INTEGER value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns a reference to the parameter value, cast as an INTEGER.
Example:
vint a = arg_reader->getIntRef("max");
VString& Vertica::ParamWriter::getLongStringRef(std::string fieldName)
inline inherited Allocates a new VString object to use as output. Sets it to be a 32mb LONG type by default.
Returns A new VString object to hold output. This object automatically added to the output row.
size_t Vertica::VerticaBlock::getNumCols() const
inline inherited Returns the number of columns held by this block.
Referenced by
- Vertica::BlockWriter::copyFromInput()
- Vertica::BlockReader::isNull()
- Vertica::BlockWriter::setNull()
const VNumeric* Vertica::ParamReader::getNumericPtr(std::string paramName) const
inline inherited Get a pointer to a VNumeric value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns A pointer to the retrieved value cast as a Numeric.
Referenced by Vertica::ParamReader::getNumericRef().
const VNumeric& Vertica::ParamReader::getNumericRef(std::string paramName) const
inline inherited Get a reference to a VNumeric value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns a reference to the parameter value, cast as an VNumeric.
VNumeric& Vertica::ParamWriter::getNumericRef(std::string fieldName)
inline inherited Allocate a new VNumeric object to use as output.
Returns A new VNumeric object to hold output. This object automatically added to the output row.
int Vertica::VerticaBlock::getNumRows() const
inline inherited Returns the number of rows held by this block.
const VString* Vertica::ParamReader::getStringPtr(std::string paramName) const
inline inherited Get a pointer to a VString value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns A pointer to the retrieved value cast as a VString.
Referenced by Vertica::ParamReader::getStringRef().
const VString& Vertica::ParamReader::getStringRef(std::string paramName) const
inline inherited Get a reference to an VString value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns a reference to the parameter value, cast as an VString.
VString& Vertica::ParamWriter::getStringRef(std::string fieldName)
inline inherited Allocates a new VString object to use as output.
Returns A new VString object to hold output. This object automatically added to the output row.
const TimeADT* Vertica::ParamReader::getTimePtr(std::string paramName) const
inline inherited Get a pointer to a TIME value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns A pointer to the retrieved value cast as a TIME.
Referenced by Vertica::ParamReader::getTimeRef().
const TimeADT& Vertica::ParamReader::getTimeRef(std::string paramName) const
inline inherited Get a reference to a TIME value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns a reference to the parameter value, cast as a TIME.
const Timestamp* Vertica::ParamReader::getTimestampPtr(std::string paramName) const
inline inherited Get a pointer to a TIMESTAMP value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns A pointer to the retrieved value cast as a TIMESTAMP.
Referenced by Vertica::ParamReader::getTimestampRef().
const Timestamp& Vertica::ParamReader::getTimestampRef(std::string paramName) const
inline inherited Get a reference to a TIMESTAMP value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns a reference to the parameter value, cast as a TIMESTAMP.
const TimestampTz* Vertica::ParamReader::getTimestampTzPtr(std::string paramName) const
inline inherited Get a pointer to a TIMESTAMP WITH TIMEZONE value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns A pointer to the retrieved value cast as a TIMESTAMP WITH TIMEZONE .
Referenced by Vertica::ParamReader::getTimestampTzRef().
const TimestampTz& Vertica::ParamReader::getTimestampTzRef(std::string paramName) const
inline inherited Get a reference to a TIMESTAMP WITH TIMEZONE value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns a reference to the parameter value, cast as a TIMESTAMP WITH TIMEZONE.
const TimeTzADT* Vertica::ParamReader::getTimeTzPtr(std::string paramName) const
inline inherited Get a pointer to a TIME WITH TIMEZONE value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns A pointer to the retrieved value cast as a TIME WITH TIMEZONE.
Referenced by Vertica::ParamReader::getTimeTzRef().
const TimeTzADT& Vertica::ParamReader::getTimeTzRef(std::string paramName) const
inline inherited Get a reference to a TIME WITH TIMEZONE value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns a reference to the parameter value, cast as a TIME WITH TIMEZONE.
const SizedColumnTypes& Vertica::VerticaBlock::getTypeMetaData() const
inline inherited Returns information about the types and numbers of arguments
Referenced by
SizedColumnTypes& Vertica::VerticaBlock::getTypeMetaData()
inline inherited Returns information about the types and numbers of arguments
VUuid* Vertica::ParamReader::getUuidPtr(std::string paramName) const
inline inherited Get a pointer to a VUuid value from the input row.
Parameters
paramName: The name of the parameter to retrieve
Returns A pointer to the retrieved value cast as a VUuid.
VUuid& Vertica::ParamWriter::getUuidRef(std::string fieldName)
inline inherited Allocate a new VUuid object to use as output.
Returns A new VUuid object to hold output. This object automatically added to the output row.
bool Vertica::VerticaBlock::remaining() const
inline inherited Returns the number of entries remaining in the block
void Vertica::ParamWriter::setAllocator(VTAllocator * allocator)
inline inherited Sets the allocator to be used to allocate variable size param values such as VString. Given allocator live longer than this ParamWriter.
Parameters
allocator: Used to allocate param values.
void Vertica::ParamWriter::setBool(std::string fieldName, vbool r)
inline inherited Adds a BOOLEAN value to the output row.
Parameters
r: The BOOLEAN value to insert into the output row.
void Vertica::ParamWriter::setDate(std::string fieldName, DateADT r)
inline inherited Adds a BOOLEAN value to the output row.
Parameters
r: The BOOLEAN value to insert into the output row.
void Vertica::ParamWriter::setFloat(std::string fieldName, vfloat r)
inline inherited Adds a FLOAT value to the output row.
Parameters
r: The FLOAT value to insert into the output row.
void Vertica::ParamWriter::setInt(std::string fieldName, vint r)
inline inherited Adds an INTEGER value to the output row.
Setter methods
Parameters
r: The INTEGER value to insert into the output row.
void Vertica::ParamWriter::setInterval(std::string fieldName, Interval r, int32 precision, int32 range)
inline inherited Adds an INTERVAL value to the output row.
Parameters
r: The INTERVAL value to insert into the output row.
void Vertica::ParamWriter::setIntervalYM(std::string fieldName, IntervalYM r, int32 range)
inline inherited Adds an INTERVAL YEAR TO MONTH value to the output row.
Parameters
r: The INTERVAL YEAR TO MONTH value to insert into the output row.
void Vertica::ParamWriter::setTime(std::string fieldName, TimeADT r, int32 precision)
inline inherited Adds a TIME value to the output row.
Parameters
r: The TIME value to insert into the output row.
void Vertica::ParamWriter::setTimestamp(std::string fieldName, Timestamp r, int32 precision)
inline inherited Adds a TIMESTAMP value to the output row.
Parameters
r: The TIMESTAMP value to insert into the output row.
void Vertica::ParamWriter::setTimestampTz(std::string fieldName, TimestampTz r, int32 precision)
inline inherited Adds a TIMESTAMP WITH TIMEZONE value to the output row.
Parameters
r: The TIMESTAMP WITH TIMEZONE value to insert into the output row.
void Vertica::ParamWriter::setTimeTz(std::string fieldName, TimeTzADT r, int32 precision)
inline inherited Adds a TIME WITH TIMEZONE value to the output row.
Parameters
r: The TIME WITH TIMEZONE value to insert into the output row.
Member Data Documentation
| std::map Vertica::ParamReader::paramNameToIndex |
|---|
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()
- Vertica::ParamReader::isEmpty()