Describes a column in an input or output table or a parameter. More...
#include <sqludr.h>
Inherits tmudr::TMUDRSerializableObject.
Public Types | |
enum | ColumnUseCode { UNKNOWN, USED, NOT_USED, NOT_PRODUCED } |
Info on whether a table-valued input or output column is used. More... | |
Public Member Functions | |
ColumnInfo () | |
ColumnInfo (const char *name, const TypeInfo &type) | |
const std::string & | getColName () const |
const TypeInfo & | getType () const |
long | getEstimatedUniqueEntries () const |
ColumnUseCode | getUsage () const |
const ProvenanceInfo & | getProvenance () const |
TypeInfo & | getType () |
void | setColName (const char *name) |
void | setType (TypeInfo &type) |
void | setEstimatedUniqueEntries (long uniqueEntries) |
void | setUsage (ColumnUseCode usage) |
void | setProvenance (const ProvenanceInfo &provenance) |
Describes a column in an input or output table or a parameter.
This describes a column or parameter value that is passed through the UDR interface, either as a value read from an input table, a value produced in an output table or a parameter.
Info on whether a table-valued input or output column is used.
ColumnInfo::ColumnInfo | ( | ) |
Default constructor
ColumnInfo::ColumnInfo | ( | const char * | name, | |
const TypeInfo & | type | |||
) |
Constructor, specifying a name and a type
name | Name of the column to add. Use UPPER CASE letters, digits and underscore, otherwise you will need to use delimited column names with matching case in Trafodion. | |
type | Type of the column to add. |
const std::string & ColumnInfo::getColName | ( | ) | const |
Get the name of the column.
long ColumnInfo::getEstimatedUniqueEntries | ( | ) | const |
Get the estimated number of unique entries.
This returns an estimate for the number of unique values for this column in the table. For example, a column containing the names of US states would have approximately 50 distinct values, assuming that most or all states are represented. This estimate can be provided by the UDR writer, through the setUniqueEntries() method, or in some cases it can also be provided by the Trafodion compiler.
const ProvenanceInfo & ColumnInfo::getProvenance | ( | ) | const |
Get provenance info for an output column.
TypeInfo & ColumnInfo::getType | ( | ) |
Non-const method to get the type.
const TypeInfo & ColumnInfo::getType | ( | ) | const |
Get the type of the column.
ColumnInfo::ColumnUseCode ColumnInfo::getUsage | ( | ) | const |
Get the usage of an input or output column.
This usage may be set in the UDR::describeDataflowAndPredicates() method, set automatically by Trafodion for certain situations with passthru columns, or left at the default of USED.
void ColumnInfo::setColName | ( | const char * | colName | ) |
Set the name of the column.
colName | Name of the column (in UTF-8). There is a length limit of 256 bytes for the column name. |
void ColumnInfo::setEstimatedUniqueEntries | ( | long | uniqueEntries | ) |
Provide an estimate for the number of unique values of a column.
Only use this method from within the following methods:
uniqueEntries | Estimate of the number of unique entries or -1 if there is no estimate. |
void ColumnInfo::setProvenance | ( | const ProvenanceInfo & | provenance | ) |
Set the provenance of an output column.
This defines a relationship between an output column and a column of a table-valued input from which the output value is copied. Such columns are called pass-thru columns. See class ProvenanceInfo for more information.
Only use this method from within the following method:
provenance | The provenance information. |
void ColumnInfo::setType | ( | TypeInfo & | type | ) |
Set the type of the column.
This is done by constructing a TypeInfo object and passing it to this method.
type | Type of the column. |
void ColumnInfo::setUsage | ( | ColumnUseCode | usage | ) |
Set the usage of the column.
See the ColumnInfo::COLUMN_USE enum for different options.
Only use this method from within the following method:
usage | Usage enum value of the column. |