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

This class represents the output value range of a UDSF. More...

Inheritance diagram for Vertica::ValueRangeWriter:
Inheritance graph
Collaboration diagram for Vertica::ValueRangeWriter:
Collaboration graph

Public Types

enum  BoundType { LO_BOUND, UP_BOUND }
 

Public Member Functions

 ValueRangeWriter (char *outLoBound, char *outUpBound, const VerticaType &dt, EE::ValueSort sortedness, bool canHaveNulls)
 
bool canHaveNulls (size_t idx) const
 Indicates if there can be NULL values in the range. More...
 
bool canHaveNulls () const
 
template<class T , BoundType b>
const T * getColPtr (size_t idx) const
 
template<class T , BoundType b>
T * getColPtrForWrite (size_t idx)
 
VNumericgetNumericRefLo ()
 Gets a VNumeric object reference to set the range lower bound. More...
 
VNumericgetNumericRefUp ()
 Gets a VNumeric object reference to set the range upper bound. More...
 
size_t getNumRanges () const
 Retrieve the number of range arguments. More...
 
const VerticaTypegetRangeType (size_t idx) const
 Returns the data type of the values in a range. More...
 
EE::ValueSort getSortedness (size_t idx) const
 
EE::ValueSort getSortedness () const
 
VStringgetStringRefLo ()
 Gets a VString object reference to set the range lower bound. More...
 
VStringgetStringRefUp ()
 Gets a VString object reference to set the range upper bound. More...
 
VUuidgetUuidRefLo ()
 Gets a VUuid object reference to set the range lower bound. More...
 
VUuidgetUuidRefUp ()
 Gets a VUuid object reference to set the range upper bound. More...
 
bool hasBounds () const
 
void setBoolLo (vbool r)
 Sets a range bound as a BOOLEAN value. More...
 
void setBoolUp (vbool r)
 
void setCanHaveNulls (bool u)
 
void setDateLo (DateADT r)
 Sets a range bound as a DATE value. More...
 
void setDateUp (DateADT r)
 
void setFloatLo (vfloat r)
 Sets a range bound as a FLOAT value to the output row. More...
 
void setFloatUp (vfloat r)
 
void setHasBounds ()
 Lets Vertica know that this output range has user-defined bounds.
 
void setIntervalLo (Interval r)
 Sets a range bound as an INTERVAL value. More...
 
void setIntervalUp (Interval r)
 
void setIntervalYMLo (IntervalYM r)
 Sets a range bound as an INTERVAL YEAR TO MONTH value. More...
 
void setIntervalYMUp (IntervalYM r)
 
void setIntLo (vint r)
 Sets a range bound as an INTEGER value. More...
 
void setIntUp (vint r)
 
void setNull ()
 Sets to NULL all values in this range. More...
 
void setSortedness (EE::ValueSort s)
 
void setTimeLo (TimeADT r)
 Sets a range bound as a TIMESTAMP value. More...
 
void setTimestampLo (Timestamp r)
 Sets a range bound as a TIMESTAMP value. More...
 
void setTimestampTzLo (TimestampTz r)
 Sets a range bound as a TIMESTAMP WITH TIMEZONE value. More...
 
void setTimestampTzUp (TimestampTz r)
 
void setTimestampUp (Timestamp r)
 
void setTimeTzLo (TimeTzADT r)
 Sets a range bound as a TIMESTAMP WITH TIMEZONE value. More...
 
void setTimeTzUp (TimeTzADT r)
 
void setTimeUp (TimeADT r)
 

Protected Member Functions

void addArg (char *loBound, char *upBound, const VerticaType &dt, EE::ValueSort sortedness, bool canHaveNulls)
 
void setCanHaveNulls (size_t idx, bool u)
 Set a flag to indicate that some values in this range can be NULL. More...
 
void setSortedness (size_t idx, EE::ValueSort s)
 

Protected Attributes

size_t narg
 
std::vector< ValueRangeranges
 
std::vector< VStringsvWrappersLo
 
std::vector< VStringsvWrappersUp
 
std::vector< VUuiduuWrappersLo
 
std::vector< VUuiduuWrappersUp
 
std::vector< VNumericvnWrappersLo
 
std::vector< VNumericvnWrappersUp
 

Friends

class EE::VEval
 

Detailed Description

This class represents the output value range of a UDSF.

Instances of this class are used to allow UDSF developers specify the output range of UDSFs via the optional ScalarFunction::getOutputRange() function.

Member Function Documentation

◆ addArg()

void Vertica::VerticaValueRange::addArg ( char *  loBound,
char *  upBound,
const VerticaType dt,
EE::ValueSort  sortedness,
bool  canHaveNulls 
)
inlineprotectedinherited

Add a value range of a particular function argument

Parameters
loBoundBase location to find the lower bound data
upBoundBase location to find the upper bound data
sortednessSortedness of values in the range
dtThe data type of range bounds

◆ canHaveNulls()

bool Vertica::VerticaValueRange::canHaveNulls ( size_t  idx) const
inlineinherited

Indicates if there can be NULL values in the range.

Parameters
idxthe range argument number.
Returns
TRUE if some range values can be NULL, else FALSE.

Referenced by Vertica::VerticaValueRange::addArg().

◆ getNumericRefLo()

VNumeric& Vertica::ValueRangeWriter::getNumericRefLo ( )
inline

Gets a VNumeric object reference to set the range lower bound.

Returns
A VNumeric object reference.

Referenced by setNull().

◆ getNumericRefUp()

VNumeric& Vertica::ValueRangeWriter::getNumericRefUp ( )
inline

Gets a VNumeric object reference to set the range upper bound.

Returns
A VNumeric object reference.

Referenced by setNull().

◆ getNumRanges()

size_t Vertica::VerticaValueRange::getNumRanges ( ) const
inlineinherited

Retrieve the number of range arguments.

Returns
the number of range arguments held by this object.

◆ getRangeType()

const VerticaType& Vertica::VerticaValueRange::getRangeType ( size_t  idx) const
inlineinherited

Returns the data type of the values in a range.

Parameters
idxThe index of the range
Returns
a VerticaType object describing the data type of the range values.

◆ getStringRefLo()

VString& Vertica::ValueRangeWriter::getStringRefLo ( )
inline

Gets a VString object reference to set the range lower bound.

Returns
A VString object reference.

Referenced by setNull().

◆ getStringRefUp()

VString& Vertica::ValueRangeWriter::getStringRefUp ( )
inline

Gets a VString object reference to set the range upper bound.

Returns
A VString object reference.

Referenced by setNull().

◆ getUuidRefLo()

VUuid& Vertica::ValueRangeWriter::getUuidRefLo ( )
inline

Gets a VUuid object reference to set the range lower bound.

Returns
A VUuid object reference.

Referenced by setNull().

◆ getUuidRefUp()

VUuid& Vertica::ValueRangeWriter::getUuidRefUp ( )
inline

Gets a VUuid object reference to set the range upper bound.

Returns
A VUuid object reference.

Referenced by setNull().

◆ setBoolLo()

void Vertica::ValueRangeWriter::setBoolLo ( vbool  r)
inline

Sets a range bound as a BOOLEAN value.

Parameters
rThe BOOLEAN value to set the range bound.

Referenced by setNull().

◆ setCanHaveNulls()

void Vertica::VerticaValueRange::setCanHaveNulls ( size_t  idx,
bool  u 
)
inlineprotectedinherited

Set a flag to indicate that some values in this range can be NULL.

Parameters
idxThe argument range number.
utrue if there can be NULL values in the range, else false.

◆ setDateLo()

void Vertica::ValueRangeWriter::setDateLo ( DateADT  r)
inline

Sets a range bound as a DATE value.

Parameters
rThe DATE value to set the range bound.

Referenced by setNull().

◆ setFloatLo()

void Vertica::ValueRangeWriter::setFloatLo ( vfloat  r)
inline

Sets a range bound as a FLOAT value to the output row.

Parameters
rThe FLOAT value to set the range bound.

Referenced by setNull().

◆ setIntervalLo()

void Vertica::ValueRangeWriter::setIntervalLo ( Interval  r)
inline

Sets a range bound as an INTERVAL value.

Parameters
rThe INTERVAL value to set the range bound.

Referenced by setNull().

◆ setIntervalYMLo()

void Vertica::ValueRangeWriter::setIntervalYMLo ( IntervalYM  r)
inline

Sets a range bound as an INTERVAL YEAR TO MONTH value.

Parameters
rThe INTERVAL YEAR TO MONTH value to set the range bound.

◆ setIntLo()

void Vertica::ValueRangeWriter::setIntLo ( vint  r)
inline

Sets a range bound as an INTEGER value.

Parameters
rThe INTEGER value to set the range bound.

Referenced by setNull().

◆ setNull()

void Vertica::ValueRangeWriter::setNull ( )
inline

Sets to NULL all values in this range.

Note
As side effect of this method, this range will be marked as having NULL values and its sortedness set to EE::SORT_CONSTANT.

◆ setTimeLo()

void Vertica::ValueRangeWriter::setTimeLo ( TimeADT  r)
inline

Sets a range bound as a TIMESTAMP value.

Parameters
rThe TIMESTAMP value to set the range bound.

Referenced by setNull().

◆ setTimestampLo()

void Vertica::ValueRangeWriter::setTimestampLo ( Timestamp  r)
inline

Sets a range bound as a TIMESTAMP value.

Parameters
rThe TIMESTAMP value to set the range bound.

Referenced by setNull().

◆ setTimestampTzLo()

void Vertica::ValueRangeWriter::setTimestampTzLo ( TimestampTz  r)
inline

Sets a range bound as a TIMESTAMP WITH TIMEZONE value.

Parameters
rThe TIMESTAMP WITH TIMEZONE value to set the range bound.

Referenced by setNull().

◆ setTimeTzLo()

void Vertica::ValueRangeWriter::setTimeTzLo ( TimeTzADT  r)
inline

Sets a range bound as a TIMESTAMP WITH TIMEZONE value.

Parameters
rThe TIMESTAMP WITH TIMEZONE value to set the range bound.

Referenced by setNull().