OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RelTranslatedJoin Class Reference

#include <RelAlgDag.h>

+ Inheritance diagram for RelTranslatedJoin:
+ Collaboration diagram for RelTranslatedJoin:

Public Member Functions

 RelTranslatedJoin (const RelAlgNode *lhs, const RelAlgNode *rhs, const std::vector< const Analyzer::ColumnVar * > lhs_join_cols, const std::vector< const Analyzer::ColumnVar * > rhs_join_cols, const std::vector< std::shared_ptr< const Analyzer::Expr >> filter_ops, const RexScalar *outer_join_cond, const bool nested_loop, const JoinType join_type, const std::string &op_type, const std::string &qualifier, const std::string &op_typeinfo)
 
virtual void acceptChildren (Visitor &v) const override
 
virtual void accept (Visitor &v, std::string name) const override
 
std::string toString (RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
 
const RelAlgNodegetLHS () const
 
const RelAlgNodegetRHS () const
 
size_t getFilterCondSize () const
 
const std::vector
< std::shared_ptr< const
Analyzer::Expr > > 
getFilterCond () const
 
const RexScalargetOuterJoinCond () const
 
std::string getOpType () const
 
std::string getQualifier () const
 
std::string getOpTypeInfo () const
 
size_t size () const override
 
JoinType getJoinType () const
 
const RexScalargetCondition () const
 
const RexScalargetAndReleaseCondition () const
 
void setCondition (std::unique_ptr< const RexScalar > &condition)
 
void replaceInput (std::shared_ptr< const RelAlgNode > old_input, std::shared_ptr< const RelAlgNode > input) override
 
std::shared_ptr< RelAlgNodedeepCopy () const override
 
std::string getFieldName (const size_t i) const
 
std::vector< const
Analyzer::ColumnVar * > 
getJoinCols (bool lhs) const
 
bool isNestedLoopQual () const
 
virtual size_t toHash () const override
 
- Public Member Functions inherited from RelAlgNode
 RelAlgNode (RelAlgInputs inputs={})
 
virtual ~RelAlgNode ()
 
void resetQueryExecutionState ()
 
void setContextData (const RaExecutionDesc *context_data) const
 
void setOutputMetainfo (std::vector< TargetMetaInfo > targets_metainfo) const
 
void setQueryPlanDag (const std::string &extracted_query_plan_dag) const
 
std::string getQueryPlanDag () const
 
size_t getQueryPlanDagHash () const
 
const std::vector
< TargetMetaInfo > & 
getOutputMetainfo () const
 
unsigned getId () const
 
bool hasContextData () const
 
const RaExecutionDescgetContextData () const
 
const size_t inputCount () const
 
const RelAlgNodegetInput (const size_t idx) const
 
const std::vector< RelAlgNode
const * > 
getInputs () const
 
std::shared_ptr< const RelAlgNodegetAndOwnInput (const size_t idx) const
 
void addManagedInput (std::shared_ptr< const RelAlgNode > input)
 
bool hasInput (const RelAlgNode *needle) const
 
void setRelNodeDagId (const size_t id) const
 
size_t getRelNodeDagId () const
 
bool isNop () const
 
void markAsNop ()
 
void clearContextData () const
 
- Public Member Functions inherited from RelAlgDagNode
 RelAlgDagNode ()
 
virtual size_t getStepNumber () const
 
virtual void setStepNumber (size_t step) const
 
std::optional< size_t > getIdInPlanTree () const
 
void setIdInPlanTree (size_t id) const
 

Private Attributes

const RelAlgNodelhs_
 
const RelAlgNoderhs_
 
const std::vector< const
Analyzer::ColumnVar * > 
lhs_join_cols_
 
const std::vector< const
Analyzer::ColumnVar * > 
rhs_join_cols_
 
const std::vector
< std::shared_ptr< const
Analyzer::Expr > > 
filter_ops_
 
const RexScalarouter_join_cond_
 
const bool nested_loop_
 
const JoinType join_type_
 
const std::string op_type_
 
const std::string qualifier_
 
const std::string op_typeinfo_
 

Friends

std::size_t hash_value (RelTranslatedJoin const &)
 

Additional Inherited Members

- Static Public Member Functions inherited from RelAlgNode
static void resetRelAlgFirstId () noexcept
 
- Protected Attributes inherited from RelAlgNode
RelAlgInputs inputs_
 
unsigned id_
 
std::optional< size_t > hash_
 
- Protected Attributes inherited from RelAlgDagNode
size_t step_ {0}
 
std::optional< size_t > id_in_plan_tree_
 

Detailed Description

Definition at line 1741 of file RelAlgDag.h.

Constructor & Destructor Documentation

RelTranslatedJoin::RelTranslatedJoin ( const RelAlgNode lhs,
const RelAlgNode rhs,
const std::vector< const Analyzer::ColumnVar * >  lhs_join_cols,
const std::vector< const Analyzer::ColumnVar * >  rhs_join_cols,
const std::vector< std::shared_ptr< const Analyzer::Expr >>  filter_ops,
const RexScalar outer_join_cond,
const bool  nested_loop,
const JoinType  join_type,
const std::string &  op_type,
const std::string &  qualifier,
const std::string &  op_typeinfo 
)
inline

Definition at line 1743 of file RelAlgDag.h.

1754  : lhs_(lhs)
1755  , rhs_(rhs)
1756  , lhs_join_cols_(lhs_join_cols)
1757  , rhs_join_cols_(rhs_join_cols)
1758  , filter_ops_(filter_ops)
1759  , outer_join_cond_(outer_join_cond)
1760  , nested_loop_(nested_loop)
1761  , join_type_(join_type)
1762  , op_type_(op_type)
1763  , qualifier_(qualifier)
1764  , op_typeinfo_(op_typeinfo) {}
const bool nested_loop_
Definition: RelAlgDag.h:1856
const RexScalar * outer_join_cond_
Definition: RelAlgDag.h:1855
const JoinType join_type_
Definition: RelAlgDag.h:1857
const std::vector< const Analyzer::ColumnVar * > lhs_join_cols_
Definition: RelAlgDag.h:1852
const RelAlgNode * rhs_
Definition: RelAlgDag.h:1851
const std::string op_type_
Definition: RelAlgDag.h:1858
const std::string qualifier_
Definition: RelAlgDag.h:1859
const RelAlgNode * lhs_
Definition: RelAlgDag.h:1850
const std::vector< std::shared_ptr< const Analyzer::Expr > > filter_ops_
Definition: RelAlgDag.h:1854
const std::vector< const Analyzer::ColumnVar * > rhs_join_cols_
Definition: RelAlgDag.h:1853
const std::string op_typeinfo_
Definition: RelAlgDag.h:1860

Member Function Documentation

virtual void RelTranslatedJoin::accept ( Visitor v,
std::string  name 
) const
inlineoverridevirtual

Implements RelAlgDagNode.

Definition at line 1782 of file RelAlgDag.h.

References acceptChildren(), and RelAlgDagNode::Visitor::visit().

Referenced by TableFunctionsFactory_node.PrintNode::__str__().

1782  {
1783  if (v.visit(this, std::move(name))) {
1784  acceptChildren(v);
1785  }
1786  }
virtual void acceptChildren(Visitor &v) const override
Definition: RelAlgDag.h:1766
string name
Definition: setup.in.py:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void RelTranslatedJoin::acceptChildren ( Visitor v) const
inlineoverridevirtual

Implements RelAlgDagNode.

Definition at line 1766 of file RelAlgDag.h.

References RelAlgDagNode::accept(), RelAlgNode::getInputs(), getLHS(), getOuterJoinCond(), getRHS(), and anonymous_namespace{Utm.h}::n.

Referenced by accept().

1766  {
1767  if (getLHS()) {
1768  getLHS()->accept(v, "left");
1769  }
1770  if (getRHS()) {
1771  getRHS()->accept(v, "right");
1772  }
1773  if (getOuterJoinCond()) {
1774  getOuterJoinCond()->accept(v, "outer condition");
1775  }
1776  for (auto& n : getInputs()) {
1777  if (n) {
1778  n->accept(v, "input");
1779  }
1780  }
1781  }
const RelAlgNode * getRHS() const
Definition: RelAlgDag.h:1808
const RelAlgNode * getLHS() const
Definition: RelAlgDag.h:1807
virtual void accept(Visitor &v, std::string name) const =0
const RexScalar * getOuterJoinCond() const
Definition: RelAlgDag.h:1813
const std::vector< RelAlgNode const * > getInputs() const
Definition: RelAlgDag.h:882
constexpr double n
Definition: Utm.h:38

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::shared_ptr<RelAlgNode> RelTranslatedJoin::deepCopy ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1832 of file RelAlgDag.h.

References CHECK.

1832  {
1833  CHECK(false);
1834  return nullptr;
1835  }
#define CHECK(condition)
Definition: Logger.h:291
const RexScalar* RelTranslatedJoin::getAndReleaseCondition ( ) const
inline

Definition at line 1823 of file RelAlgDag.h.

References CHECK.

1823  {
1824  CHECK(false);
1825  return nullptr;
1826  }
#define CHECK(condition)
Definition: Logger.h:291
const RexScalar* RelTranslatedJoin::getCondition ( ) const
inline

Definition at line 1819 of file RelAlgDag.h.

References CHECK.

1819  {
1820  CHECK(false);
1821  return nullptr;
1822  }
#define CHECK(condition)
Definition: Logger.h:291
std::string RelTranslatedJoin::getFieldName ( const size_t  i) const
const std::vector<std::shared_ptr<const Analyzer::Expr> > RelTranslatedJoin::getFilterCond ( ) const
inline

Definition at line 1810 of file RelAlgDag.h.

References filter_ops_.

1810  {
1811  return filter_ops_;
1812  }
const std::vector< std::shared_ptr< const Analyzer::Expr > > filter_ops_
Definition: RelAlgDag.h:1854
size_t RelTranslatedJoin::getFilterCondSize ( ) const
inline

Definition at line 1809 of file RelAlgDag.h.

References filter_ops_.

1809 { return filter_ops_.size(); }
const std::vector< std::shared_ptr< const Analyzer::Expr > > filter_ops_
Definition: RelAlgDag.h:1854
std::vector<const Analyzer::ColumnVar*> RelTranslatedJoin::getJoinCols ( bool  lhs) const
inline

Definition at line 1837 of file RelAlgDag.h.

References lhs_join_cols_, and rhs_join_cols_.

Referenced by QueryPlanDagExtractor::handleTranslatedJoin().

1837  {
1838  if (lhs) {
1839  return lhs_join_cols_;
1840  }
1841  return rhs_join_cols_;
1842  }
const std::vector< const Analyzer::ColumnVar * > lhs_join_cols_
Definition: RelAlgDag.h:1852
const std::vector< const Analyzer::ColumnVar * > rhs_join_cols_
Definition: RelAlgDag.h:1853

+ Here is the caller graph for this function:

JoinType RelTranslatedJoin::getJoinType ( ) const
inline

Definition at line 1818 of file RelAlgDag.h.

References join_type_.

1818 { return join_type_; }
const JoinType join_type_
Definition: RelAlgDag.h:1857
const RelAlgNode* RelTranslatedJoin::getLHS ( ) const
inline

Definition at line 1807 of file RelAlgDag.h.

References lhs_.

Referenced by acceptChildren(), QueryPlanDagExtractor::handleTranslatedJoin(), and RelRexDagVisitor::visit().

1807 { return lhs_; }
const RelAlgNode * lhs_
Definition: RelAlgDag.h:1850

+ Here is the caller graph for this function:

std::string RelTranslatedJoin::getOpType ( ) const
inline

Definition at line 1814 of file RelAlgDag.h.

References op_type_.

1814 { return op_type_; }
const std::string op_type_
Definition: RelAlgDag.h:1858
std::string RelTranslatedJoin::getOpTypeInfo ( ) const
inline

Definition at line 1816 of file RelAlgDag.h.

References op_typeinfo_.

1816 { return op_typeinfo_; }
const std::string op_typeinfo_
Definition: RelAlgDag.h:1860
const RexScalar* RelTranslatedJoin::getOuterJoinCond ( ) const
inline

Definition at line 1813 of file RelAlgDag.h.

References outer_join_cond_.

Referenced by acceptChildren(), and RelRexDagVisitor::visit().

1813 { return outer_join_cond_; }
const RexScalar * outer_join_cond_
Definition: RelAlgDag.h:1855

+ Here is the caller graph for this function:

std::string RelTranslatedJoin::getQualifier ( ) const
inline

Definition at line 1815 of file RelAlgDag.h.

References qualifier_.

1815 { return qualifier_; }
const std::string qualifier_
Definition: RelAlgDag.h:1859
const RelAlgNode* RelTranslatedJoin::getRHS ( ) const
inline

Definition at line 1808 of file RelAlgDag.h.

References rhs_.

Referenced by acceptChildren(), QueryPlanDagExtractor::handleTranslatedJoin(), and RelRexDagVisitor::visit().

1808 { return rhs_; }
const RelAlgNode * rhs_
Definition: RelAlgDag.h:1851

+ Here is the caller graph for this function:

bool RelTranslatedJoin::isNestedLoopQual ( ) const
inline

Definition at line 1843 of file RelAlgDag.h.

References nested_loop_.

Referenced by QueryPlanDagExtractor::handleTranslatedJoin().

1843 { return nested_loop_; }
const bool nested_loop_
Definition: RelAlgDag.h:1856

+ Here is the caller graph for this function:

void RelTranslatedJoin::replaceInput ( std::shared_ptr< const RelAlgNode old_input,
std::shared_ptr< const RelAlgNode input 
)
inlineoverridevirtual

Reimplemented from RelAlgNode.

Definition at line 1828 of file RelAlgDag.h.

References CHECK.

1829  {
1830  CHECK(false);
1831  }
#define CHECK(condition)
Definition: Logger.h:291
void RelTranslatedJoin::setCondition ( std::unique_ptr< const RexScalar > &  condition)
inline

Definition at line 1827 of file RelAlgDag.h.

References CHECK.

1827 { CHECK(false); }
#define CHECK(condition)
Definition: Logger.h:291
size_t RelTranslatedJoin::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1817 of file RelAlgDag.h.

1817 { return 0; }
virtual size_t RelTranslatedJoin::toHash ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1845 of file RelAlgDag.h.

References hash_value.

1845 { return hash_value(*this); }
friend std::size_t hash_value(RelTranslatedJoin const &)
Definition: RelAlgDag.cpp:3713
std::string RelTranslatedJoin::toString ( RelRexToStringConfig  config = RelRexToStringConfig::defaults()) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1788 of file RelAlgDag.h.

References filter_ops_, join_type_, lhs_join_cols_, nested_loop_, op_type_, op_typeinfo_, outer_join_cond_, qualifier_, rhs_join_cols_, RelAlgDagNode::toString(), and typeName().

1789  {
1790  std::ostringstream oss;
1791  oss << ::typeName(this) << "( join_quals { lhs: " << ::toString(lhs_join_cols_);
1792  oss << "rhs: " << ::toString(rhs_join_cols_);
1793  oss << " }, filter_quals: { " << ::toString(filter_ops_);
1794  oss << " }, outer_join_cond: { ";
1795  if (outer_join_cond_) {
1796  oss << outer_join_cond_->toString(config);
1797  } else {
1798  oss << "N/A";
1799  }
1800  oss << " }, loop_join: " << ::toString(nested_loop_);
1801  oss << ", join_type: " << ::toString(join_type_);
1802  oss << ", op_type: " << ::toString(op_type_);
1803  oss << ", qualifier: " << ::toString(qualifier_);
1804  oss << ", op_type_info: " << ::toString(op_typeinfo_) << ")";
1805  return oss.str();
1806  }
std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
Definition: RelAlgDag.h:1788
const bool nested_loop_
Definition: RelAlgDag.h:1856
const RexScalar * outer_join_cond_
Definition: RelAlgDag.h:1855
const JoinType join_type_
Definition: RelAlgDag.h:1857
const std::vector< const Analyzer::ColumnVar * > lhs_join_cols_
Definition: RelAlgDag.h:1852
const std::string op_type_
Definition: RelAlgDag.h:1858
const std::string qualifier_
Definition: RelAlgDag.h:1859
const std::vector< std::shared_ptr< const Analyzer::Expr > > filter_ops_
Definition: RelAlgDag.h:1854
const std::vector< const Analyzer::ColumnVar * > rhs_join_cols_
Definition: RelAlgDag.h:1853
virtual std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const =0
std::string typeName(const T *v)
Definition: toString.h:106
const std::string op_typeinfo_
Definition: RelAlgDag.h:1860

+ Here is the call graph for this function:

Friends And Related Function Documentation

std::size_t hash_value ( RelTranslatedJoin const &  rel_tr_join)
friend

Definition at line 3713 of file RelAlgDag.cpp.

Referenced by toHash().

3713  {
3714  if (rel_tr_join.hash_) {
3715  return *rel_tr_join.hash_;
3716  }
3717  rel_tr_join.hash_ = typeid(RelTranslatedJoin).hash_code();
3718  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.lhs_);
3719  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.rhs_);
3720  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.outer_join_cond_);
3721  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.nested_loop_);
3722  boost::hash_combine(*rel_tr_join.hash_, ::toString(rel_tr_join.join_type_));
3723  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.op_type_);
3724  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.qualifier_);
3725  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.op_typeinfo_);
3726  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.filter_ops_);
3727  return *rel_tr_join.hash_;
3728 }
std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
Definition: RelAlgDag.h:1788
RelTranslatedJoin(const RelAlgNode *lhs, const RelAlgNode *rhs, const std::vector< const Analyzer::ColumnVar * > lhs_join_cols, const std::vector< const Analyzer::ColumnVar * > rhs_join_cols, const std::vector< std::shared_ptr< const Analyzer::Expr >> filter_ops, const RexScalar *outer_join_cond, const bool nested_loop, const JoinType join_type, const std::string &op_type, const std::string &qualifier, const std::string &op_typeinfo)
Definition: RelAlgDag.h:1743

Member Data Documentation

const std::vector<std::shared_ptr<const Analyzer::Expr> > RelTranslatedJoin::filter_ops_
private

Definition at line 1854 of file RelAlgDag.h.

Referenced by getFilterCond(), getFilterCondSize(), hash_value(), and toString().

const JoinType RelTranslatedJoin::join_type_
private

Definition at line 1857 of file RelAlgDag.h.

Referenced by getJoinType(), hash_value(), and toString().

const RelAlgNode* RelTranslatedJoin::lhs_
private

Definition at line 1850 of file RelAlgDag.h.

Referenced by getLHS(), and hash_value().

const std::vector<const Analyzer::ColumnVar*> RelTranslatedJoin::lhs_join_cols_
private

Definition at line 1852 of file RelAlgDag.h.

Referenced by getJoinCols(), and toString().

const bool RelTranslatedJoin::nested_loop_
private

Definition at line 1856 of file RelAlgDag.h.

Referenced by hash_value(), isNestedLoopQual(), and toString().

const std::string RelTranslatedJoin::op_type_
private

Definition at line 1858 of file RelAlgDag.h.

Referenced by getOpType(), hash_value(), and toString().

const std::string RelTranslatedJoin::op_typeinfo_
private

Definition at line 1860 of file RelAlgDag.h.

Referenced by getOpTypeInfo(), hash_value(), and toString().

const RexScalar* RelTranslatedJoin::outer_join_cond_
private

Definition at line 1855 of file RelAlgDag.h.

Referenced by getOuterJoinCond(), hash_value(), and toString().

const std::string RelTranslatedJoin::qualifier_
private

Definition at line 1859 of file RelAlgDag.h.

Referenced by getQualifier(), hash_value(), and toString().

const RelAlgNode* RelTranslatedJoin::rhs_
private

Definition at line 1851 of file RelAlgDag.h.

Referenced by getRHS(), and hash_value().

const std::vector<const Analyzer::ColumnVar*> RelTranslatedJoin::rhs_join_cols_
private

Definition at line 1853 of file RelAlgDag.h.

Referenced by getJoinCols(), and toString().


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