casacore
|
#include <TableParseJoin.h>
Public Member Functions | |
TableParseJoin (TableParseQuery *) | |
void | addTable (Int tabnr, const String &name, const Table &table, const String &shorthand, const std::vector< const Table * > &tempTables, const std::vector< TableParseQuery * > &stack) |
Add a join table nr, name, or object to the container. | |
void | handleCondition (const TableExprNode &expr) |
Handle the ON condition of a join. | |
Int64 | findRow (const TableExprId &id) const |
Find the row in the join table for the given main table row. | |
Private Member Functions | |
void | splitAnd (const TENShPtr &node, std::vector< TENShPtr > &parts) |
Split the ON condition recursively into its AND parts. | |
void | handleConditionParts (std::vector< TENShPtr > &parts) |
Handle all AND parts of the join condition. | |
uInt | findMatchingTables (const std::vector< Table > &exprTables, const std::vector< Table > &tables) const |
Tell how many tables in the exprTables vector are the same as those in the tables vector. | |
rownr_t | checkNrow (const std::vector< Table > &) const |
Check if all join tables in the vector have the same number of rows. | |
void | addUniqueTables (std::vector< Table > &tables, const std::vector< Table > &other) |
Add the tables in the other vector to the tables vector. | |
Private Attributes | |
TableParseQuery * | itsParent |
std::vector< Table > | itsFromTables |
std::vector< Table > | itsJoinTables |
Int | itsParentJoinIndex |
std::shared_ptr< TaQLJoinBase > | itsJoin |
Int64 | itsLastMainRow |
Int64 | itsLastJoinRow |
Class handling a join clause in a TaQL command
Internal
TableParseQuery holds a vector of TableParseJoin objects, one for each join clause in a TaQL command.
TableParseJoin holds the join condition expression and the from and join tables involved in the expression. The from tables are all tables in the TaQL command prior to this join clause. The join tables are the tables mentioned in the join clause. TableParseJoin also tells if the join is nested in another join by keeping the index of the parent TableParseJoin object in the vector in TableParseQuery.
The ON condition expression is split in its AND parts; basically each part involves a column comparison. Each part must contain an = for an exact match or IN comparison for matching an interval. A tree, consisting of TaQLJoinBase objects, is built to execute the condition. It finds the matching row in the join table given a row in the main table. Each level in the tree is an AND part in the condition.
Definition at line 70 of file TableParseJoin.h.
|
explicit |
void casacore::TableParseJoin::addTable | ( | Int | tabnr, |
const String & | name, | ||
const Table & | table, | ||
const String & | shorthand, | ||
const std::vector< const Table * > & | tempTables, | ||
const std::vector< TableParseQuery * > & | stack | ||
) |
Add a join table nr, name, or object to the container.
|
private |
Add the tables in the other vector to the tables vector.
Only do that for tables not occurring in the tables vector yet.
Check if all join tables in the vector have the same number of rows.
|
private |
Tell how many tables in the exprTables vector are the same as those in the tables vector.
Int64 casacore::TableParseJoin::findRow | ( | const TableExprId & | id | ) | const |
Find the row in the join table for the given main table row.
void casacore::TableParseJoin::handleCondition | ( | const TableExprNode & | expr | ) |
Handle the ON condition of a join.
|
private |
Handle all AND parts of the join condition.
|
private |
Split the ON condition recursively into its AND parts.
|
private |
Definition at line 113 of file TableParseJoin.h.
|
private |
Definition at line 117 of file TableParseJoin.h.
|
private |
Definition at line 114 of file TableParseJoin.h.
|
mutableprivate |
Definition at line 119 of file TableParseJoin.h.
|
mutableprivate |
Definition at line 118 of file TableParseJoin.h.
|
private |
Definition at line 112 of file TableParseJoin.h.
|
private |
Definition at line 116 of file TableParseJoin.h.