C++ SDK Documentation  24.2.0
Vertica::AnalyticPartitionReader Class Reference

Provides an iterator-based read interface over all the partition_by keys, order_by keys, and function arguments in a partition. More...

Inheritance diagram for Vertica::AnalyticPartitionReader:
Inheritance graph
Collaboration diagram for Vertica::AnalyticPartitionReader:
Collaboration graph

Public Member Functions

 AnalyticPartitionReader (size_t narg, EE::UserDefinedProcess *udx_object)
 
void copy (const VerticaBlock &other)
 
Array::ArrayReader getArrayRef (size_t idx) const
 Get a reference to an Array value from the input row. More...
 
const vboolgetBoolPtr (size_t idx) const
 Get a pointer to a BOOLEAN value from the input row. More...
 
const vboolgetBoolRef (size_t idx) 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 VStringgetColPtr (size_t idx) const
 
template<>
const VNumericgetColPtr (size_t idx) const
 
template<>
const VUuidgetColPtr (size_t idx) const
 
template<>
const BlockReadergetColPtr (size_t idx) const
 
template<class T >
T * getColPtrForWrite (size_t idx)
 
template<>
VStringgetColPtrForWrite (size_t idx)
 
template<>
VNumericgetColPtrForWrite (size_t idx)
 
template<>
VUuidgetColPtrForWrite (size_t idx)
 
template<>
BlockWritergetColPtrForWrite (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::DataAreagetDataArea (size_t idx) const
 
const DateADTgetDatePtr (size_t idx) const
 Get a pointer to a DATE value from the input row. More...
 
const DateADTgetDateRef (size_t idx) const
 Get a reference to a DATE value from the input row. More...
 
const vfloatgetFloatPtr (size_t idx) const
 Get a pointer to a FLOAT value from the input row. More...
 
const vfloatgetFloatRef (size_t idx) const
 Get a reference to a FLOAT value from the input row. More...
 
const IntervalgetIntervalPtr (size_t idx) const
 Get a pointer to an INTERVAL value from the input row. More...
 
const IntervalgetIntervalRef (size_t idx) const
 Get a reference to an INTERVAL value from the input row. More...
 
const IntervalYMgetIntervalYMPtr (size_t idx) const
 Get a pointer to a INTERVAL YEAR TO MONTH value from the input row. More...
 
const IntervalYMgetIntervalYMRef (size_t idx) const
 Get a reference to an INTERVAL YEAR TO MONTH value from the input row. More...
 
const vintgetIntPtr (size_t idx) const
 Get a pointer to an INTEGER value from the input row. More...
 
const vintgetIntRef (size_t idx) const
 Get a reference to an INTEGER value from the input row. More...
 
size_t getNumCols () const
 
const VNumericgetNumericPtr (size_t idx) const
 Get a pointer to a VNumeric value from the input row. More...
 
const VNumericgetNumericRef (size_t idx) const
 Get a reference to a VNumeric value from the input row. More...
 
int getNumRows () const
 
int getPosition () const
 
const BlockReadergetRowPtr (size_t idx) const
 Get a reference to a Row value from the input row. More...
 
const BlockReadergetRowRef (size_t idx) const
 Get a reference to a Row value from the input row. More...
 
const VStringgetStringPtr (size_t idx) const
 Get a pointer to a VString value from the input row. More...
 
const VStringgetStringRef (size_t idx) const
 Get a reference to an VString value from the input row. More...
 
const TimeADTgetTimePtr (size_t idx) const
 Get a pointer to a TIME value from the input row. More...
 
const TimeADTgetTimeRef (size_t idx) const
 Get a reference to a TIME value from the input row. More...
 
const TimestampgetTimestampPtr (size_t idx) const
 Get a pointer to a TIMESTAMP value from the input row. More...
 
const TimestampgetTimestampRef (size_t idx) const
 Get a reference to a TIMESTAMP value from the input row. More...
 
const TimestampTzgetTimestampTzPtr (size_t idx) const
 Get a pointer to a TIMESTAMP WITH TIMEZONE value from the input row. More...
 
const TimestampTzgetTimestampTzRef (size_t idx) const
 Get a reference to a TIMESTAMP WITH TIMEZONE value from the input row. More...
 
const TimeTzADTgetTimeTzPtr (size_t idx) const
 Get a pointer to a TIME WITH TIMEZONE value from the input row. More...
 
const TimeTzADTgetTimeTzRef (size_t idx) const
 Get a reference to a TIME WITH TIMEZONE value from the input row. More...
 
const SizedColumnTypesgetTypeMetaData () const
 
SizedColumnTypesgetTypeMetaData ()
 
const VUuidgetUuidPtr (size_t idx) const
 Get a pointer to a VUuid value from the input row. More...
 
const VUuidgetUuidRef (size_t idx) const
 Get a reference to a VUuid value from the input row. More...
 
void * getVoidPtr (size_t idx=0)
 
const void * getVoidPtr (size_t idx=0) const
 
bool hasData () const
 
bool hasMoreData ()
 
bool isNewOrderByKey ()
 
bool isNull (int col) const
 Check if the idx'th argument is null. More...
 
bool next ()
 
virtual bool readNextBlock () __override__
 
bool remaining () const
 
virtual void resetForDataAreaFlush ()
 
void setDataArea (size_t idx, void *dataarea)
 
bool willFetchBlockOnNext ()
 

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 resetIndex ()
 
void setRowCount (int rowCount)
 
virtual void setupColsAndStrides () __override__
 
void validateStringColumn (size_t idx, const VString &s, size_t colLength) const
 

Protected Attributes

union {
   EE::UserDefinedAnalytic *   udan
 
   EE::UserDefinedTransform *   udt
 
   EE::UserDefinedProcess *   udx_object
 
}; 
 
std::vector< char * > cols
 
std::vector< int > colstrides
 
int count
 
std::vector< NestedBlockPtrctWrappers
 
EE::DataHolder * dh
 
int index
 
const int * indices
 
size_t ncols
 
std::vector< bool > newOrderMarkers
 
int nrows
 
std::vector< BaseDataOID > processBlockUserInfoVector
 
vpos pstart
 
std::vector< VStringsvWrappers
 
SizedColumnTypes typeMetaData
 
std::vector< VUuiduuWrappers
 
std::vector< VNumericvnWrappers
 

Friends

class ::AnalyticPartitionReaderHelper
 
class EE::UserDefinedAnalytic
 
class EE::UserDefinedProcess
 

Detailed Description

Provides an iterator-based read interface over all the partition_by keys, order_by keys, and function arguments in a partition.

Member Function Documentation

◆ addCol()

void Vertica::VerticaBlock::addCol ( char *  arg,
int  colstride,
const Field field 
)
protectedinherited

Add the location for reading a particular argument.

Parameters
argThe base location to find data.
colstrideThe stride between data instances.
fieldmetadata for the added column
dtThe type of input.
fieldnamethe name of the field

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

◆ getArrayIntermediateDataArea()

EE::DataArea** Vertica::VerticaBlock::getArrayIntermediateDataArea ( size_t  c)
inlineprotectedinherited
Returns
a pointer to a DataArea for accumulating an intermediate result

◆ getArrayRef()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
a reference to the idx'th argument: another BlockReader which reads elements of the array.

◆ getBoolPtr()

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

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

Parameters
idxThe column number in the input row to retrieve.
Returns
A pointer to the retrieved value cast as a BOOLEAN.

Referenced by Vertica::BlockReader::getBoolRef().

◆ getBoolRef()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
a reference to the idx'th argument, cast as an BOOLEAN.

Referenced by Vertica::BlockReader::isNull().

◆ getColPtr()

template<class T >
const T* Vertica::VerticaBlock::getColPtr ( size_t  idx) const
inlineinherited
Returns
a pointer to the idx'th argument, cast appropriately.

Example:

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

◆ getColRef()

template<class T >
const T& Vertica::VerticaBlock::getColRef ( size_t  idx) const
inlineinherited
Returns
a pointer to the idx'th argument, cast appropriately.

Example: const vint a = arg_reader->getColRef<vint>(0);

◆ getDatePtr()

const DateADT* Vertica::BlockReader::getDatePtr ( size_t  idx) const
inlineinherited

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

Parameters
idxThe column number in the input row to retrieve.
Returns
A pointer to the retrieved value cast as a DATE.

Referenced by Vertica::BlockReader::getDateRef().

◆ getDateRef()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
a reference to the idx'th argument, cast as an DATE.

Referenced by Vertica::BlockReader::isNull().

◆ getFloatPtr()

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

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

Parameters
idxThe column number in the input row to retrieve.
Returns
A pointer to the retrieved value cast as a FLOAT.

Referenced by Vertica::BlockReader::getFloatRef().

◆ getFloatRef()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
A reference to the idx'th argument, cast as an FLOAT.

Referenced by Vertica::BlockReader::isNull().

◆ getIntervalPtr()

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

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

Parameters
idxThe column number in the input row to retrieve.
Returns
A pointer to the retrieved value cast as an INTERVAL.

Referenced by Vertica::BlockReader::getIntervalRef().

◆ getIntervalRef()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
a reference to the idx'th argument, cast as an INTERVAL.

Referenced by Vertica::BlockReader::isNull().

◆ getIntervalYMPtr()

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

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

Parameters
idxThe column number in the input row to retrieve.
Returns
A point to the retrieved value cast as a INTERVAL YEAR TO MONTH.

Referenced by Vertica::BlockReader::getIntervalYMRef().

◆ getIntervalYMRef()

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

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

Parameters
idxThe 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 Vertica::BlockReader::isNull().

◆ getIntPtr()

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

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

Returns
a pointer to the idx'th argument, cast appropriately.
Parameters
idxThe column number to retrieve from the input row.

Example:

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

Referenced by Vertica::BlockReader::getIntRef().

◆ getIntRef()

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

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

Parameters
idxThe 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 Vertica::BlockReader::isNull().

◆ getNumCols()

size_t Vertica::VerticaBlock::getNumCols ( ) const
inlineinherited
Returns
the number of columns held by this block.

Referenced by Vertica::BlockWriter::copyFromInput(), Vertica::BlockReader::isNull(), and Vertica::BlockWriter::setNull().

◆ getNumericPtr()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
A pointer to the retrieved value cast as a Numeric.

Referenced by Vertica::BlockReader::getNumericRef().

◆ getNumericRef()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
a reference to the idx'th argument, cast as an VNumeric.

Referenced by Vertica::BlockReader::isNull().

◆ getNumRows()

int Vertica::VerticaBlock::getNumRows ( ) const
inlineinherited
Returns
the number of rows held by this block.

◆ getPosition()

int Vertica::BlockReader::getPosition ( ) const
inlineinherited
Returns
the current row position or array index

◆ getRowPtr()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
a pointer to a reader for the Row fields

Referenced by Vertica::BlockReader::getRowRef().

◆ getRowRef()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
a reference to the idx'th argument, as a Row value.

◆ getStringPtr()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
A pointer to the retrieved value cast as a VString.

Referenced by Vertica::BlockReader::getStringRef().

◆ getStringRef()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
a reference to the idx'th argument, cast as an VString.

Referenced by Vertica::BlockReader::isNull().

◆ getTimePtr()

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

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

Parameters
idxThe column number in the input row to retrieve.
Returns
A pointer to the retrieved value cast as a TIME.

Referenced by Vertica::BlockReader::getTimeRef().

◆ getTimeRef()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
a reference to the idx'th argument, cast as a TIME.

Referenced by Vertica::BlockReader::isNull().

◆ getTimestampPtr()

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

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

Parameters
idxThe column number in the input row to retrieve.
Returns
A pointer to the retrieved value cast as a TIMESTAMP.

Referenced by Vertica::BlockReader::getTimestampRef().

◆ getTimestampRef()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
a reference to the idx'th argument, cast as a TIMESTAMP.

Referenced by Vertica::BlockReader::isNull().

◆ getTimestampTzPtr()

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

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

Parameters
idxThe column number in the input row to retrieve.
Returns
A pointer to the retrieved value cast as a TIMESTAMP WITH TIMEZONE .

Referenced by Vertica::BlockReader::getTimestampTzRef().

◆ getTimestampTzRef()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
a reference to the idx'th argument, cast as a TIMESTAMP WITH TIMEZONE.

Referenced by Vertica::BlockReader::isNull().

◆ getTimeTzPtr()

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

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

Parameters
idxThe column number in the input row to retrieve.
Returns
A pointer to the retrieved value cast as a TIME WITH TIMEZONE.

Referenced by Vertica::BlockReader::getTimeTzRef().

◆ getTimeTzRef()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
a reference to the idx'th argument, cast as a TIME WITH TIMEZONE.

Referenced by Vertica::BlockReader::isNull().

◆ getTypeMetaData() [1/2]

const SizedColumnTypes& Vertica::VerticaBlock::getTypeMetaData ( ) const
inlineinherited
Returns
information about the types and numbers of arguments

Referenced by Vertica::ParamReader::getType(), Vertica::BlockReader::isNull(), and Vertica::BlockWriter::setNull().

◆ getTypeMetaData() [2/2]

SizedColumnTypes& Vertica::VerticaBlock::getTypeMetaData ( )
inlineinherited
Returns
information about the types and numbers of arguments

◆ getUuidPtr()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
A pointer to the retrieved value cast as a VUuid.

Referenced by Vertica::BlockReader::getUuidRef().

◆ getUuidRef()

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
a reference to the idx'th argument, cast as an VUuid.

Referenced by Vertica::BlockReader::isNull().

◆ hasData()

bool Vertica::BlockReader::hasData ( ) const
inlineinherited
Returns
true if there is data available

Referenced by Vertica::copyBlockColumn().

◆ isNull()

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

Check if the idx'th argument is null.

Parameters
colThe column number in the row to check for null
Returns
true is the col value is null false otherwise

◆ readNextBlock()

virtual bool Vertica::AnalyticPartitionReader::readNextBlock ( )
virtual

Reads in the next block of data and positions cursor at the beginning.

Returns
false if there's no more input data

Reimplemented from Vertica::PartitionReader.

◆ remaining()

bool Vertica::VerticaBlock::remaining ( ) const
inlineinherited
Returns
the number of entries remaining in the block

◆ resetForDataAreaFlush()

virtual void Vertica::VerticaBlock::resetForDataAreaFlush ( )
inlinevirtualinherited

Virtual method to be called when the Data Area fills up in a load. Should be called from the StreamWriter class.

Reimplemented in Vertica::StreamWriter.