OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RexInput Class Reference

#include <RelAlgDag.h>

+ Inheritance diagram for RexInput:
+ Collaboration diagram for RexInput:

Public Member Functions

 RexInput ()
 
 RexInput (const RelAlgNode *node, const unsigned in_index)
 
virtual void acceptChildren (Visitor &v) const override
 
virtual void accept (Visitor &v, std::string name) const override
 
const RelAlgNodegetSourceNode () const
 
void setSourceNode (const RelAlgNode *node) const
 
bool operator== (const RexInput &that) const
 
std::string toString (RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
 
std::unique_ptr< RexInputdeepCopy () const
 
virtual size_t toHash () const override
 
- Public Member Functions inherited from RexAbstractInput
 RexAbstractInput ()
 
 RexAbstractInput (const unsigned in_index)
 
unsigned getIndex () const
 
void setIndex (const unsigned in_index) const
 
- Public Member Functions inherited from Rex
virtual ~Rex ()
 
virtual size_t getStepNumber () const
 
- Public Member Functions inherited from RelAlgDagNode
 RelAlgDagNode ()
 
virtual void setStepNumber (size_t step) const
 
std::optional< size_t > getIdInPlanTree () const
 
void setIdInPlanTree (size_t id) const
 

Private Attributes

const RelAlgNodenode_
 

Friends

struct RelAlgDagSerializer
 
std::size_t hash_value (RexInput const &)
 

Additional Inherited Members

- Protected Attributes inherited from Rex
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 1037 of file RelAlgDag.h.

Constructor & Destructor Documentation

RexInput::RexInput ( )
inline

Definition at line 1040 of file RelAlgDag.h.

1040 : node_{nullptr} {}
const RelAlgNode * node_
Definition: RelAlgDag.h:1079
RexInput::RexInput ( const RelAlgNode node,
const unsigned  in_index 
)
inline

Definition at line 1042 of file RelAlgDag.h.

1043  : RexAbstractInput(in_index), node_(node) {}
const RelAlgNode * node_
Definition: RelAlgDag.h:1079

Member Function Documentation

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

Reimplemented from RexAbstractInput.

Definition at line 1050 of file RelAlgDag.h.

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

Referenced by TableFunctionsFactory_node.PrintNode::__str__().

1050  {
1051  if (v.visit(this, std::move(name))) {
1052  acceptChildren(v);
1053  }
1054  }
virtual void acceptChildren(Visitor &v) const override
Definition: RelAlgDag.h:1045
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 RexInput::acceptChildren ( Visitor v) const
inlineoverridevirtual

Reimplemented from RexAbstractInput.

Definition at line 1045 of file RelAlgDag.h.

References RelAlgDagNode::accept(), and getSourceNode().

Referenced by accept().

1045  {
1046  if (getSourceNode()) {
1047  getSourceNode()->accept(v, "source");
1048  }
1049  }
virtual void accept(Visitor &v, std::string name) const =0
const RelAlgNode * getSourceNode() const
Definition: RelAlgDag.h:1056

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::unique_ptr<RexInput> RexInput::deepCopy ( ) const
inline

Definition at line 1070 of file RelAlgDag.h.

References RexAbstractInput::getIndex(), and node_.

Referenced by anonymous_namespace{RelAlgOptimizer.cpp}::RexProjectInputRedirector::visitInput(), RexDeepCopyVisitor::visitInput(), RexInputRenumber< bAllowMissing >::visitInput(), and anonymous_namespace{RelAlgOptimizer.cpp}::RexInputRenumberVisitor::visitInput().

1070  {
1071  return std::make_unique<RexInput>(node_, getIndex());
1072  }
unsigned getIndex() const
Definition: RelAlgDag.h:174
const RelAlgNode * node_
Definition: RelAlgDag.h:1079

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool RexInput::operator== ( const RexInput that) const
inline

Definition at line 1063 of file RelAlgDag.h.

References RexAbstractInput::getIndex(), and getSourceNode().

1063  {
1064  return getSourceNode() == that.getSourceNode() && getIndex() == that.getIndex();
1065  }
unsigned getIndex() const
Definition: RelAlgDag.h:174
const RelAlgNode * getSourceNode() const
Definition: RelAlgDag.h:1056

+ Here is the call graph for this function:

void RexInput::setSourceNode ( const RelAlgNode node) const
inline

Definition at line 1061 of file RelAlgDag.h.

References node_.

Referenced by RelLogicalUnion::copyAndRedirectSource(), anonymous_namespace{RelAlgOptimizer.cpp}::RexRebindInputsVisitor::visitInput(), anonymous_namespace{RelAlgDag.cpp}::RexRebindInputsVisitor::visitInput(), and anonymous_namespace{RelLeftDeepInnerJoin.cpp}::RebindRexInputsFromLeftDeepJoin::visitInput().

1061 { node_ = node; }
const RelAlgNode * node_
Definition: RelAlgDag.h:1079

+ Here is the caller graph for this function:

virtual size_t RexInput::toHash ( ) const
inlineoverridevirtual

Reimplemented from RexAbstractInput.

Definition at line 1074 of file RelAlgDag.h.

References hash_value.

Referenced by std::hash< RexInput >::operator()(), and anonymous_namespace{RelAlgDag.cpp}::PushDownGenericExpressionInWindowFunction::visitInput().

1074 { return hash_value(*this); }
friend std::size_t hash_value(RexInput const &)
Definition: RelAlgDag.cpp:3681

+ Here is the caller graph for this function:

std::string RexInput::toString ( RelRexToStringConfig  config = RelRexToStringConfig::defaults()) const
overridevirtual

Reimplemented from RexAbstractInput.

Definition at line 3496 of file RelAlgDag.cpp.

References cat(), RelScan::getFieldName(), RelAlgNode::getId(), RelAlgDagNode::getIdInPlanTree(), RexAbstractInput::getIndex(), node_, RelRexToStringConfig::skip_input_nodes, to_string(), RelAlgNode::toString(), and typeName().

3496  {
3497  const auto scan_node = dynamic_cast<const RelScan*>(node_);
3498  if (scan_node) {
3499  auto field_name = scan_node->getFieldName(getIndex());
3500  auto table_name = scan_node->getTableDescriptor()->tableName;
3501  return ::typeName(this) + "(" + table_name + "." + field_name + ")";
3502  }
3503  auto node_id_in_plan = node_->getIdInPlanTree();
3504  auto node_id_str =
3505  node_id_in_plan ? std::to_string(*node_id_in_plan) : std::to_string(node_->getId());
3506  auto node_str = config.skip_input_nodes ? "(input_node_id=" + node_id_str
3507  : "(input_node=" + node_->toString(config);
3508  return cat(::typeName(this), node_str, ", in_index=", std::to_string(getIndex()), ")");
3509 }
std::string cat(Ts &&...args)
std::optional< size_t > getIdInPlanTree() const
Definition: RelAlgDag.h:134
std::string to_string(char const *&&v)
const std::string getFieldName(const size_t i) const
Definition: RelAlgDag.h:1127
unsigned getIndex() const
Definition: RelAlgDag.h:174
const RelAlgNode * node_
Definition: RelAlgDag.h:1079
virtual std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const =0
std::string typeName(const T *v)
Definition: toString.h:106

+ Here is the call graph for this function:

Friends And Related Function Documentation

std::size_t hash_value ( RexInput const &  rex_input)
friend

Definition at line 3681 of file RelAlgDag.cpp.

Referenced by toHash().

3681  {
3682  if (rex_input.hash_) {
3683  return *rex_input.hash_;
3684  }
3685  rex_input.hash_ = typeid(RexInput).hash_code();
3686  boost::hash_combine(*rex_input.hash_, rex_input.node_);
3687  boost::hash_combine(*rex_input.hash_, rex_input.getIndex());
3688  return *rex_input.hash_;
3689 }
friend struct RelAlgDagSerializer
friend

Definition at line 1081 of file RelAlgDag.h.

Member Data Documentation

const RelAlgNode* RexInput::node_
mutableprivate

Definition at line 1079 of file RelAlgDag.h.

Referenced by deepCopy(), getSourceNode(), hash_value(), setSourceNode(), and toString().


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