Vertica::BlockWriter Class Reference

Iterator interface for writing rows to a Vertica block. More...

Inheritance diagram for Vertica::BlockWriter:

Vertica::VerticaBlock List of all members.

Public Member Functions

 BlockWriter (char *outArr, int stride, int rowcount, const int *indices, const VerticaType &dt)
template<class T>
const T * getColPtr (size_t idx)
template<class T>
T * getColPtrForWrite (size_t idx)
template<class T>
const T & getColRef (size_t idx)
template<class T>
T & getColRefForWrite (size_t idx)
const EE::DataArea * getDataArea (size_t idx)
size_t getNumCols () const
VNumeric & getNumericRef ()
 Allocate a new VNumeric object to use as output.
int getNumRows () const
VString & getStringRef ()
 Allocates a new VString object to use as output.
SizedColumnTypes & getTypeMetaData ()
const SizedColumnTypes & getTypeMetaData () const
void * getVoidPtr ()
void next ()
 Complete writing this row of output and move to the next row.
void setBool (vbool r)
 Adds a BOOLEAN value to the output row.
void setDataArea (size_t idx, void *dataarea)
void setDate (DateADT r)
 Adds a BOOLEAN value to the output row.
void setFloat (vfloat r)
 Adds a FLOAT value to the output row.
void setInt (vint r)
 Adds an INTEGER value to the output row.
void setInterval (Interval r)
 Adds an INTERVAL value to the output row.
void setIntervalYM (IntervalYM r)
 Adds an INTERVAL YEAR TO MONTH value to the output row.
void setTime (TimeADT r)
 Adds a TIMESTAMP value to the output row.
void setTimestamp (Timestamp r)
 Adds a TIMESTAMP value to the output row.
void setTimestampTz (TimestampTz r)
 Adds a TIMESTAMP WITH TIMEZONE value to the output row.
void setTimeTz (TimeTzADT r)
 Adds a TIMESTAMP WITH TIMEZONE value to the output row.

Protected Member Functions

void addCol (const char *arg, int colstride, const VerticaType &dt, const std::string fieldName="")
void addCol (char *arg, int colstride, const VerticaType &dt, const std::string fieldName="")
void validateStringColumn (size_t idx, const VString &s, const VerticaType &t)
friend void::copyDataToPlanPool (VerticaBlock *block)

Protected Attributes

std::vector< char * > cols
std::vector< int > colstrides
int count
int index
const int * indices
size_t ncols
int nrows
std::vector< VString > svWrappers
SizedColumnTypes typeMetaData
std::vector< VNumeric > vnWrappers

Friends

class ::EE::UserDefinedAggregate
class ::EE::UserDefinedAnalytic
class ::EE::UserDefinedProcess
class ::EE::UserDefinedTransform
class AggregateFunction
struct CPPExecContext
class EE::VEval
class VerticaBlockSerializer

Detailed Description

Iterator interface for writing rows to a Vertica block.

This class provides the output rows that ScalarFunction.processBlock() writes to.


Member Function Documentation

void Vertica::VerticaBlock::addCol ( char *  arg,
int  colstride,
const VerticaType &  dt,
const std::string  fieldName = "" 
) [inline, protected, inherited]

Add the location for reading a particular argument.

Parameters:
arg The base location to find data.
colstride The stride between data instances.
dt The type of input.
fieldname the name of the field

template<class T>
const T* Vertica::VerticaBlock::getColPtr ( size_t  idx  )  [inline, inherited]

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

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

template<class T>
const T& Vertica::VerticaBlock::getColRef ( size_t  idx  )  [inline, inherited]

Returns:
a pointer to the idx'th argument, cast appropriately.
Example: const vint a = arg_reader->getColRef<vint>(0);

size_t Vertica::VerticaBlock::getNumCols (  )  const [inline, inherited]

Returns:
the number of columns held by this block.

VNumeric& Vertica::BlockWriter::getNumericRef (  )  [inline]

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.

VString& Vertica::BlockWriter::getStringRef (  )  [inline]

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.

SizedColumnTypes& Vertica::VerticaBlock::getTypeMetaData (  )  [inline, inherited]

Returns:
information about the types and numbers of arguments

const SizedColumnTypes& Vertica::VerticaBlock::getTypeMetaData (  )  const [inline, inherited]

Returns:
information about the types and numbers of arguments

void Vertica::BlockWriter::setBool ( vbool  r  )  [inline]

Adds a BOOLEAN value to the output row.

Parameters:
r The BOOLEAN value to insert into the output row.

void Vertica::BlockWriter::setDate ( DateADT  r  )  [inline]

Adds a BOOLEAN value to the output row.

Parameters:
r The BOOLEAN value to insert into the output row.

void Vertica::BlockWriter::setFloat ( vfloat  r  )  [inline]

Adds a FLOAT value to the output row.

Parameters:
r The FLOAT value to insert into the output row.

void Vertica::BlockWriter::setInt ( vint  r  )  [inline]

Adds an INTEGER value to the output row.

Parameters:
r The INTEGER value to insert into the output row.

void Vertica::BlockWriter::setInterval ( Interval  r  )  [inline]

Adds an INTERVAL value to the output row.

Parameters:
r The INTERVAL value to insert into the output row.

void Vertica::BlockWriter::setIntervalYM ( IntervalYM  r  )  [inline]

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::BlockWriter::setTime ( TimeADT  r  )  [inline]

Adds a TIMESTAMP value to the output row.

Parameters:
r The TIMESTAMP value to insert into the output row.

void Vertica::BlockWriter::setTimestamp ( Timestamp  r  )  [inline]

Adds a TIMESTAMP value to the output row.

Parameters:
r The TIMESTAMP value to insert into the output row.

void Vertica::BlockWriter::setTimestampTz ( TimestampTz  r  )  [inline]

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::BlockWriter::setTimeTz ( TimeTzADT  r  )  [inline]

Adds a TIMESTAMP WITH TIMEZONE value to the output row.

Parameters:
r The TIMESTAMP WITH TIMEZONE value to insert into the output row.