Partitioning key of an input table or result table. More...
#include <sqludr.h>
Public Types | |
enum | PartitionTypeCode { UNKNOWN, ANY, SERIAL, PARTITION, REPLICATE } |
Public Member Functions | |
PartitionInfo () | |
PartitionTypeCode | getType () const |
int | getNumEntries () const |
int | getColumnNum (int i) const |
void | setType (PartitionTypeCode type) |
void | addEntry (int colNum) |
void | clear () |
Partitioning key of an input table or result table.
Describes the partitioning key of a table-valued input or result. When executing a UDR in parallel, if a table is partitioned on some columns, e.g. (a,b), this means that a rows with particular values for (a,b), e.g. (10, 20) will all go to the same parallel instance and will be seen as a contiguous group. This is similar to the key of a reducer in MapReduce, except that in this case we process a group of rows with the same key, not a single key and a list of values.
Type of partitioning
PartitionInfo::PartitionInfo | ( | ) |
Default constructor
Use this constructor to generate an object to be passed to UDRInvocationInfo::setChildPartitioning().
void PartitionInfo::addEntry | ( | int | colNum | ) |
Add a new column to the list of partitioning columns
Add a new column to the list of column numbers that form the partitioning key. Use this only if the type of the partitioning is set to PARTITION.
colNum | Number of the column (ordinal, 0-based) of the associated table. |
UDRException |
void PartitionInfo::clear | ( | ) |
Clear the contents of the object
int PartitionInfo::getColumnNum | ( | int | i | ) | const |
Get the number/ordinal of the ith partitioning column.
UDRException |
int PartitionInfo::getNumEntries | ( | ) | const |
Get the number of columns that form the partitioning key
Returns the number of columns in the list of partitioning keys or zero if there are no such columns.
PartitionInfo::PartitionTypeCode PartitionInfo::getType | ( | ) | const |
Get the partitioning type.
void PartitionInfo::setType | ( | PartitionTypeCode | type | ) |
Set the partitioning type.
type | Partition type enum. |