This project has retired. For details please refer to its Attic page.
tmudr: tmudr::ColumnInfo Class Reference

tmudr::ColumnInfo Class Reference

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 TypeInfogetType () const
long getEstimatedUniqueEntries () const
ColumnUseCode getUsage () const
const ProvenanceInfogetProvenance () const
TypeInfogetType ()
void setColName (const char *name)
void setType (TypeInfo &type)
void setEstimatedUniqueEntries (long uniqueEntries)
void setUsage (ColumnUseCode usage)
void setProvenance (const ProvenanceInfo &provenance)

Detailed Description

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.


Member Enumeration Documentation

Info on whether a table-valued input or output column is used.

Enumerator:
UNKNOWN 

Column usage is not yet determined.

USED 

For an input, it’s needed by the UDF, for an output it’s needed by the SQL Engine

NOT_USED 

Input or output is not needed. Input will be removed after the describeDataflowAndPredicates() call. Output will be retained to avoid errors at runtime when the UDF tries to set this column value.

NOT_PRODUCED 

Output is not needed and will be removed after the describeDataflowAndPredicates() call.


Constructor & Destructor Documentation

ColumnInfo::ColumnInfo (  ) 

Default constructor

ColumnInfo::ColumnInfo ( const char *  name,
const TypeInfo type 
)

Constructor, specifying a name and a type

Parameters:
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.

Member Function Documentation

const std::string & ColumnInfo::getColName (  )  const

Get the name of the column.

Returns:
Name of the column in UTF-8.
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.

See also:
ColumnInfo::setEstimatedUniqueEntries()
Returns:
Estimated number of unique entries or -1 if there is no estimate.
const ProvenanceInfo & ColumnInfo::getProvenance (  )  const

Get provenance info for an output column.

Returns:
Provenance of the column.
TypeInfo & ColumnInfo::getType (  ) 

Non-const method to get the type.

Returns:
Non-const type of the column. Note that the types of parameters and output columns can only be changed from the UDR::describeParamsAndColumns() call.
const TypeInfo & ColumnInfo::getType (  )  const

Get the type of the column.

Returns:
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.

Returns:
Usage enum value for the column.
void ColumnInfo::setColName ( const char *  colName  ) 

Set the name of the column.

Parameters:
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:

See also:
ColumnInfo::getEstimatedUniqueEntries()
Parameters:
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:

Parameters:
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.

Parameters:
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:

Parameters:
usage Usage enum value of the column.

The documentation for this class was generated from the following files:
 All Data Structures Functions Enumerations Enumerator

Generated on 31 Aug 2016 for tmudr by  doxygen 1.6.1