casacore
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::TableParseJoin Class Reference

More...

#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

TableParseQueryitsParent
 
std::vector< TableitsFromTables
 
std::vector< TableitsJoinTables
 
Int itsParentJoinIndex
 
std::shared_ptr< TaQLJoinBaseitsJoin
 
Int64 itsLastMainRow
 
Int64 itsLastJoinRow
 

Detailed Description

Class handling a join clause in a TaQL command

Intended use:

Internal

Review Status

Reviewed By:
Tammo Jan Dijkema
Date Reviewed:
2022/12/15
Test programs:
tTableGramJoin

Synopsis

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.

Constructor & Destructor Documentation

◆ TableParseJoin()

casacore::TableParseJoin::TableParseJoin ( TableParseQuery )
explicit

Member Function Documentation

◆ addTable()

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.

◆ addUniqueTables()

void casacore::TableParseJoin::addUniqueTables ( std::vector< Table > &  tables,
const std::vector< Table > &  other 
)
private

Add the tables in the other vector to the tables vector.

Only do that for tables not occurring in the tables vector yet.

◆ checkNrow()

rownr_t casacore::TableParseJoin::checkNrow ( const std::vector< Table > &  ) const
private

Check if all join tables in the vector have the same number of rows.

◆ findMatchingTables()

uInt casacore::TableParseJoin::findMatchingTables ( const std::vector< Table > &  exprTables,
const std::vector< Table > &  tables 
) const
private

Tell how many tables in the exprTables vector are the same as those in the tables vector.

◆ findRow()

Int64 casacore::TableParseJoin::findRow ( const TableExprId id) const

Find the row in the join table for the given main table row.

◆ handleCondition()

void casacore::TableParseJoin::handleCondition ( const TableExprNode expr)

Handle the ON condition of a join.

◆ handleConditionParts()

void casacore::TableParseJoin::handleConditionParts ( std::vector< TENShPtr > &  parts)
private

Handle all AND parts of the join condition.

◆ splitAnd()

void casacore::TableParseJoin::splitAnd ( const TENShPtr node,
std::vector< TENShPtr > &  parts 
)
private

Split the ON condition recursively into its AND parts.

Member Data Documentation

◆ itsFromTables

std::vector<Table> casacore::TableParseJoin::itsFromTables
private

Definition at line 113 of file TableParseJoin.h.

◆ itsJoin

std::shared_ptr<TaQLJoinBase> casacore::TableParseJoin::itsJoin
private

Definition at line 117 of file TableParseJoin.h.

◆ itsJoinTables

std::vector<Table> casacore::TableParseJoin::itsJoinTables
private

Definition at line 114 of file TableParseJoin.h.

◆ itsLastJoinRow

Int64 casacore::TableParseJoin::itsLastJoinRow
mutableprivate

Definition at line 119 of file TableParseJoin.h.

◆ itsLastMainRow

Int64 casacore::TableParseJoin::itsLastMainRow
mutableprivate

Definition at line 118 of file TableParseJoin.h.

◆ itsParent

TableParseQuery* casacore::TableParseJoin::itsParent
private

Definition at line 112 of file TableParseJoin.h.

◆ itsParentJoinIndex

Int casacore::TableParseJoin::itsParentJoinIndex
private

Definition at line 116 of file TableParseJoin.h.


The documentation for this class was generated from the following file: