C++ SDK Documentation  9.0
Vertica::VerticaType Class Reference

Represents types of data that are passed into and returned back from user's code. More...

Collaboration diagram for Vertica::VerticaType:
Collaboration graph

Public Member Functions

int32 getIntervalPrecision () const
 For INTERVAL data types, returns the precision.
 
int32 getIntervalRange () const
 For INTERVAL data types, returns the range.
 
int32 getMaxSize () const
 Returns the maximum size, in bytes, of a data element of this type.
 
int32 getNumericFractional () const
 For NUMERIC data types, returns the number of fractional digits (i.e., digits right of the decimal point)
 
int32 getNumericIntegral () const
 For NUMERIC data types, returns the number of integral digits (i.e., digits left of the decimal point)
 
int32 getNumericLength () const
 For NUMERIC data types, returns the number of bytes required to store an element. Calling this with a non-numeric data type can cause a crash.
 
int32 getNumericPrecision () const
 For NUMERIC data types, returns the precision.
 
int32 getNumericScale () const
 For NUMERIC data types, returns the scale.
 
int32 getNumericWordCount () const
 
std::string getPrettyPrintStr () const
 Return human readable type string.
 
int32 getStringLength (bool checkType=true) const
 For VARCHAR/CHAR/VARBINARY/BINARY data types, returns the length of the string.
 
int32 getTimePrecision () const
 For TIMESTAMP data types, returns the precision.
 
int32 getTimestampPrecision () const
 For TIMESTAMP data types, returns the precision.
 
const char * getTypeStr () const
 
Oid getUnderlyingType () const
 
bool isBinary () const
 Returns true if this type is BINARY, false otherwise.
 
bool isBool () const
 Returns true if this type is BOOLEAN, false otherwise.
 
bool isChar () const
 Returns true if this type is CHAR, false otherwise.
 
bool isDate () const
 Returns true if this type is DATE, false otherwise.
 
bool isFloat () const
 Returns true if this type is FLOAT, false otherwise.
 
bool isInt () const
 Returns true if this type is INTEGER, false otherwise.
 
bool isInterval () const
 Returns true if this type is INTERVAL, false otherwise.
 
bool isIntervalYM () const
 Returns true if this type is INTERVAL YEAR TO MONTH, false otherwise.
 
bool isLongVarbinary () const
 Returns true if this type is LONG VARCHAR, false otherwise.
 
bool isLongVarchar () const
 Returns true if this type is LONG VARCHAR, false otherwise.
 
bool isNumeric () const
 Returns true if this type is NUMERIC, false otherwise.
 
bool isStringOid (Oid typeOid) const
 
bool isStringType () const
 Return true for VARCHAR/CHAR/VARBINARY/BINARY/LONG VARCHAR/LONG VARBINARY data types.
 
bool isTime () const
 Returns true if this type is TIME, false otherwise.
 
bool isTimestamp () const
 Returns true if this type is TIMESTAMP, false otherwise.
 
bool isTimestampTz () const
 Returns true if this type is TIMESTAMP WITH TIMEZONE, false otherwise.
 
bool isTimeTz () const
 Returns true if this type is TIME WITH TIMEZONE, false otherwise.
 
bool isUuid () const
 Returns true if this type is UUID, false otherwise.
 
bool isVarbinary () const
 Returns true if this type is VARBINARY, false otherwise.
 
bool isVarchar () const
 Returns true if this type is VARCHAR, false otherwise.
 
bool operator!= (const VerticaType &rhs) const
 
bool operator== (const VerticaType &rhs) const
 
void setIntervalPrecision (int32 precision)
 For INTERVAL data types, sets the precision.
 
void setIntervalRange (int32 range)
 For INTERVAL data types, sets the range.
 
void setNumericPrecision (int32 precision)
 For NUMERIC data types, sets the precision.
 
void setNumericScale (int32 scale)
 For NUMERIC data types, sets the scale.
 
void setTimePrecision (int32 precision)
 For TIMESTAMP data types, sets the precision.
 
void setTimestampPrecision (int32 precision)
 For TIMESTAMP data types, sets the precision.
 

Static Public Member Functions

static Oid isBuiltInType (const Oid typeOid)
 

Detailed Description

Represents types of data that are passed into and returned back from user's code.

Member Function Documentation

Oid Vertica::VerticaType::getUnderlyingType ( ) const
inline
Returns
If this is a built in type, returns the typeOid. Otherwise, if a user defined type returns the base type oid on which the user type is based.

Note: This function is designed so that the common case (aka a built in, non user defined type) is fast – calling isUDType() is a heavyweight operation. – See VER-24673 for an example of when it matters.

Referenced by Vertica::VerticaBlock::addCol(), Vertica::ValueRangeReader::isNull(), and Vertica::ValueRangeWriter::setNull().