Vertica::BlockReader Class Reference

Iterator interface for reading rows in a Vertica block.

Inheritance diagram for Vertica::BlockReader:

Collaboration diagram for Vertica::BlockReader:

Public Member Functions
BlockReader (size_t narg, int rowcount, const int *indices)
void copy (const VerticaBlock &other)
Array::ArrayReader getArrayRef (size_t idx) const
Get a reference to an Array value from the input row.
const vbool * getBoolPtr (size_t idx) const
Get a pointer to a BOOLEAN value from the input row.
const vbool & getBoolRef (size_t idx) 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 (size_t idx) const
Get a pointer to a DATE value from the input row.
const DateADT & getDateRef (size_t idx) const
Get a reference to a DATE value from the input row.
const vfloat * getFloatPtr (size_t idx) const
Get a pointer to a FLOAT value from the input row.
const vfloat & getFloatRef (size_t idx) const
Get a reference to a FLOAT value from the input row.
const Interval * getIntervalPtr (size_t idx) const
Get a pointer to an INTERVAL value from the input row.
const Interval & getIntervalRef (size_t idx) const
Get a reference to an INTERVAL value from the input row.
const IntervalYM * getIntervalYMPtr (size_t idx) const
Get a pointer to a INTERVAL YEAR TO MONTH value from the input row.
const IntervalYM & getIntervalYMRef (size_t idx) const
Get a reference to an INTERVAL YEAR TO MONTH value from the input row.
const vint * getIntPtr (size_t idx) const
Get a pointer to an INTEGER value from the input row.
const vint & getIntRef (size_t idx) const
Get a reference to an INTEGER value from the input row.
size_t getNumCols () const
const VNumeric * getNumericPtr (size_t idx) const
Get a pointer to a VNumeric value from the input row.
const VNumeric & getNumericRef (size_t idx) const
Get a reference to a VNumeric value from the input row.
int getNumRows () const
int getPosition () const
const BlockReader * getRowPtr (size_t idx) const
Get a reference to a Row value from the input row.
const BlockReader & getRowRef (size_t idx) const
Get a reference to a Row value from the input row.
const VString * getStringPtr (size_t idx) const
Get a pointer to a VString value from the input row.
const VString & getStringRef (size_t idx) const
Get a reference to an VString value from the input row.
const TimeADT * getTimePtr (size_t idx) const
Get a pointer to a TIME value from the input row.
const TimeADT & getTimeRef (size_t idx) const
Get a reference to a TIME value from the input row.
const Timestamp * getTimestampPtr (size_t idx) const
Get a pointer to a TIMESTAMP value from the input row.
const Timestamp & getTimestampRef (size_t idx) const
Get a reference to a TIMESTAMP value from the input row.
const TimestampTz * getTimestampTzPtr (size_t idx) const
Get a pointer to a TIMESTAMP WITH TIMEZONE value from the input row.
const TimestampTz & getTimestampTzRef (size_t idx) const
Get a reference to a TIMESTAMP WITH TIMEZONE value from the input row.
const TimeTzADT * getTimeTzPtr (size_t idx) const
Get a pointer to a TIME WITH TIMEZONE value from the input row.
const TimeTzADT & getTimeTzRef (size_t idx) const
Get a reference to a TIME WITH TIMEZONE value from the input row.
const SizedColumnTypes & getTypeMetaData () const
SizedColumnTypes & getTypeMetaData ()
const VUuid * getUuidPtr (size_t idx) const
Get a pointer to a VUuid value from the input row.
const VUuid & getUuidRef (size_t idx) const
Get a reference to a VUuid value from the input row.
void * getVoidPtr (size_t idx=0)
const void * getVoidPtr (size_t idx=0) const
bool hasData () const
bool isNull (int col) const
Check if the idx'th argument is null.
bool next ()
bool remaining () const
void setDataArea (size_t idx, void *dataarea)
Protected Member Functions
void addCol (char *arg, int colstride, const Field &field)
void addCol (const char *arg, int colstride, const Field &field)
bool advanceToNextRow (bool recurIntoArrays)
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
Friends
class Array::ArrayReader
class EE::VEval
class VerticaBlockSerializer
class VerticaRInterface

Detailed Description

Iterator interface for reading rows in a Vertica block.

This class provides the input to the ScalarFunction.processBlock() function. You extract values from the input row using data type specific functions to extract each column value. You can also determine the number of columns and their data types, if your processBlock function does not have hard-coded input expectations.

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 column
  • dt: The type of input.
  • fieldname: the name of the field

Referenced by Vertica::ParamReader::addParameter().

EE::DataArea** Vertica::VerticaBlock::getArrayIntermediateDataArea(size_t c)

inlineprotectedinherited

Returns a pointer to a DataArea for accumulating an intermediate result

Array::ArrayReader Vertica::BlockReader::getArrayRef(size_t idx) const

Get a reference to an Array value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a reference to the idx'th argument: another BlockReader which reads elements of the array.

const vbool* Vertica::BlockReader::getBoolPtr(size_t idx) const

inline Get a pointer to a BOOLEAN value from the input row.

Parameters

  • idx: The column number in the input row to retrieve.

Returns A pointer to the retrieved value cast as a BOOLEAN.

Referenced by getBoolRef().

const vbool& Vertica::BlockReader::getBoolRef(size_t idx) const

inline Get a reference to a BOOLEAN value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a reference to the idx'th argument, cast as an BOOLEAN.

Referenced by isNull().

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::BlockReader::getDatePtr(size_t idx) const

inline Get a pointer to a DATE value from the input row.

Parameters

  • idx: The column number in the input row to retrieve.

Returns A pointer to the retrieved value cast as a DATE.

Referenced by getDateRef().

const DateADT& Vertica::BlockReader::getDateRef(size_t idx) const

inline Get a reference to a DATE value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a reference to the idx'th argument, cast as an DATE.

Referenced by isNull().

const vfloat* Vertica::BlockReader::getFloatPtr(size_t idx) const

inline Get a pointer to a FLOAT value from the input row.

Parameters

  • idx: The column number in the input row to retrieve.

Returns A pointer to the retrieved value cast as a FLOAT.

Referenced by getFloatRef().

const vfloat& Vertica::BlockReader::getFloatRef(size_t idx) const

inline Get a reference to a FLOAT value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns A reference to the idx'th argument, cast as an FLOAT.

Referenced by isNull().

const Interval* Vertica::BlockReader::getIntervalPtr(size_t idx) const

inline Get a pointer to an INTERVAL value from the input row.

Parameters

  • idx: The column number in the input row to retrieve.

Returns A pointer to the retrieved value cast as an INTERVAL.

Referenced by getIntervalRef().

const Interval& Vertica::BlockReader::getIntervalRef(size_t idx) const

inline Get a reference to an INTERVAL value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a reference to the idx'th argument, cast as an INTERVAL.

Referenced by isNull().

const IntervalYM* Vertica::BlockReader::getIntervalYMPtr(size_t idx) const

inline Get a pointer to a INTERVAL YEAR TO MONTH value from the input row.

Parameters

  • idx: The column number in the input row to retrieve.

Returns A point to the retrieved value cast as a INTERVAL YEAR TO MONTH.

Referenced by getIntervalYMRef().

const IntervalYM& Vertica::BlockReader::getIntervalYMRef(size_t idx) const

inline Get a reference to an INTERVAL YEAR TO MONTH value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a reference to the idx'th argument, cast as an INTERVAL YEAR TO MONTH.

Referenced by isNull().

const vint* Vertica::BlockReader::getIntPtr(size_t idx) const

inline Get a pointer to an INTEGER value from the input row.

Returns a pointer to the idx'th argument, cast appropriately.

Parameters

  • idx: The column number to retrieve from the input row.

Example:

const vint *a = arg_reader->getIntPtr(0);

Referenced by getIntRef().

const vint& Vertica::BlockReader::getIntRef(size_t idx) const

inline Get a reference to an INTEGER value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a reference to the idx'th argument, cast as an INTEGER.

Example:

const vint a = arg_reader->getIntRef(0);

Referenced by isNull().

size_t Vertica::VerticaBlock::getNumCols() const

inline inherited Returns the number of columns held by this block.

Referenced by

const VNumeric* Vertica::BlockReader::getNumericPtr(size_t idx) const

inline Get a pointer to a VNumeric value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns A pointer to the retrieved value cast as a Numeric.

Referenced by getNumericRef().

const VNumeric& Vertica::BlockReader::getNumericRef(size_t idx) const

inline Get a reference to a VNumeric value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a reference to the idx'th argument, cast as an VNumeric.

Referenced by isNull().

int Vertica::VerticaBlock::getNumRows() const

inline inherited Returns the number of rows held by this block.

int Vertica::BlockReader::getPosition() const

inline Returns the current row position or array index

const BlockReader* Vertica::BlockReader::getRowPtr(size_t idx) const

inline Get a reference to a Row value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a pointer to a reader for the Row fields

Referenced by getRowRef().

const BlockReader& Vertica::BlockReader::getRowRef(size_t idx) const

inline Get a reference to a Row value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a reference to the idx'th argument, as a Row value.

const VString* Vertica::BlockReader::getStringPtr(size_t idx) const

inline Get a pointer to a VString value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns A pointer to the retrieved value cast as a VString.

Referenced by getStringRef().

const VString& Vertica::BlockReader::getStringRef(size_t idx) const

inline Get a reference to an VString value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a reference to the idx'th argument, cast as an VString.

Referenced by isNull().

const TimeADT* Vertica::BlockReader::getTimePtr(size_t idx) const

inline Get a pointer to a TIME value from the input row.

Parameters

  • idx: The column number in the input row to retrieve.

Returns A pointer to the retrieved value cast as a TIME.

Referenced by getTimeRef().

const TimeADT& Vertica::BlockReader::getTimeRef(size_t idx) const

inline Get a reference to a TIME value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a reference to the idx'th argument, cast as a TIME.

Referenced by isNull().

const Timestamp* Vertica::BlockReader::getTimestampPtr(size_t idx) const

inline Get a pointer to a TIMESTAMP value from the input row.

Parameters

  • idx: The column number in the input row to retrieve.

Returns A pointer to the retrieved value cast as a TIMESTAMP.

Referenced by getTimestampRef().

const Timestamp& Vertica::BlockReader::getTimestampRef(size_t idx) const

inline Get a reference to a TIMESTAMP value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a reference to the idx'th argument, cast as a TIMESTAMP.

Referenced by isNull().

const TimestampTz* Vertica::BlockReader::getTimestampTzPtr(size_t idx) const

inline Get a pointer to a TIMESTAMP WITH TIMEZONE value from the input row.

Parameters

  • idx: The column number in the input row to retrieve.

Returns A pointer to the retrieved value cast as a TIMESTAMP WITH TIMEZONE .

Referenced by getTimestampTzRef().

const TimestampTz& Vertica::BlockReader::getTimestampTzRef(size_t idx) const

inline Get a reference to a TIMESTAMP WITH TIMEZONE value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a reference to the idx'th argument, cast as a TIMESTAMP WITH TIMEZONE.

Referenced by isNull().

const TimeTzADT* Vertica::BlockReader::getTimeTzPtr(size_t idx) const

inline Get a pointer to a TIME WITH TIMEZONE value from the input row.

Parameters

  • idx: The column number in the input row to retrieve.

Returns A pointer to the retrieved value cast as a TIME WITH TIMEZONE.

Referenced by getTimeTzRef().

const TimeTzADT& Vertica::BlockReader::getTimeTzRef(size_t idx) const

inline Get a reference to a TIME WITH TIMEZONE value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a reference to the idx'th argument, cast as a TIME WITH TIMEZONE.

Referenced by isNull().

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

const VUuid* Vertica::BlockReader::getUuidPtr(size_t idx) const

inline Get a pointer to a VUuid value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns A pointer to the retrieved value cast as a VUuid.

Referenced by getUuidRef().

const VUuid& Vertica::BlockReader::getUuidRef(size_t idx) const

inline Get a reference to a VUuid value from the input row.

Parameters

  • idx: The column number to retrieve from the input row.

Returns a reference to the idx'th argument, cast as an VUuid.

Referenced by isNull().

bool Vertica::BlockReader::hasData() const

inline Returns true if there is data available

Referenced by Vertica::copyBlockColumn().

bool Vertica::BlockReader::isNull(int col) const

inline Check if the idx'th argument is null.

Parameters

  • col: The column number in the row to check for null

Returns true is the col value is null false otherwise

bool Vertica::BlockReader::next()

inline Advance to the next record.

Returns true if there are more rows to read, false otherwise.

Referenced by Vertica::copyBlockColumn().

bool Vertica::VerticaBlock::remaining() const

inline inherited Returns the number of entries remaining in the block