OmniSciDB  c0231cc57d
 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 (const RelAlgNode *node, const unsigned in_index)
 
const RelAlgNodegetSourceNode () const
 
void setSourceNode (const RelAlgNode *node) const
 
bool operator== (const RexInput &that) const
 
std::string toString (RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
 
size_t toHash () const override
 
std::unique_ptr< RexInputdeepCopy () const
 
- Public Member Functions inherited from RexAbstractInput
 RexAbstractInput (const unsigned in_index)
 
unsigned getIndex () const
 
void setIndex (const unsigned in_index) const
 
- Public Member Functions inherited from Rex
virtual ~Rex ()
 

Private Attributes

const RelAlgNodenode_
 

Additional Inherited Members

- Protected Attributes inherited from Rex
std::optional< size_t > hash_
 

Detailed Description

Definition at line 346 of file RelAlgDag.h.

Constructor & Destructor Documentation

RexInput::RexInput ( const RelAlgNode node,
const unsigned  in_index 
)
inline

Definition at line 348 of file RelAlgDag.h.

Referenced by toHash().

349  : RexAbstractInput(in_index), node_(node) {}
RexAbstractInput(const unsigned in_index)
Definition: RelAlgDag.h:70
const RelAlgNode * node_
Definition: RelAlgDag.h:372

+ Here is the caller graph for this function:

Member Function Documentation

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

Definition at line 367 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().

367  {
368  return std::make_unique<RexInput>(node_, getIndex());
369  }
unsigned getIndex() const
Definition: RelAlgDag.h:72
const RelAlgNode * node_
Definition: RelAlgDag.h:372

+ 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 358 of file RelAlgDag.h.

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

358  {
359  return getSourceNode() == that.getSourceNode() && getIndex() == that.getIndex();
360  }
unsigned getIndex() const
Definition: RelAlgDag.h:72
const RelAlgNode * getSourceNode() const
Definition: RelAlgDag.h:351

+ Here is the call graph for this function:

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

Definition at line 356 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().

356 { node_ = node; }
const RelAlgNode * node_
Definition: RelAlgDag.h:372

+ Here is the caller graph for this function:

size_t RexInput::toHash ( ) const
overridevirtual

Reimplemented from RexAbstractInput.

Definition at line 3261 of file RelAlgDag.cpp.

References RexAbstractInput::getIndex(), Rex::hash_, node_, RexInput(), and RelAlgNode::toHash().

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

3261  {
3262  if (!hash_) {
3263  hash_ = typeid(RexInput).hash_code();
3264  boost::hash_combine(*hash_, node_->toHash());
3265  boost::hash_combine(*hash_, getIndex());
3266  }
3267  return *hash_;
3268 }
RexInput(const RelAlgNode *node, const unsigned in_index)
Definition: RelAlgDag.h:348
unsigned getIndex() const
Definition: RelAlgDag.h:72
std::optional< size_t > hash_
Definition: RelAlgDag.h:62
const RelAlgNode * node_
Definition: RelAlgDag.h:372
virtual size_t toHash() const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from RexAbstractInput.

Definition at line 3246 of file RelAlgDag.cpp.

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

3246  {
3247  const auto scan_node = dynamic_cast<const RelScan*>(node_);
3248  if (scan_node) {
3249  auto field_name = scan_node->getFieldName(getIndex());
3250  auto table_name = scan_node->getTableDescriptor()->tableName;
3251  return ::typeName(this) + "(" + table_name + "." + field_name + ")";
3252  }
3253  auto node_id_in_plan = node_->getIdInPlanTree();
3254  auto node_id_str =
3255  node_id_in_plan ? std::to_string(*node_id_in_plan) : std::to_string(node_->getId());
3256  auto node_str = config.skip_input_nodes ? "(input_node_id=" + node_id_str
3257  : "(input_node=" + node_->toString(config);
3258  return cat(::typeName(this), node_str, ", in_index=", std::to_string(getIndex()), ")");
3259 }
std::string cat(Ts &&...args)
std::optional< size_t > getIdInPlanTree() const
Definition: RelAlgDag.h:818
std::string to_string(char const *&&v)
const std::string getFieldName(const size_t i) const
Definition: RelAlgDag.h:919
virtual std::string toString(RelRexToStringConfig config) const =0
unsigned getIndex() const
Definition: RelAlgDag.h:72
const RelAlgNode * node_
Definition: RelAlgDag.h:372
std::string typeName(const T *v)
Definition: toString.h:103

+ Here is the call graph for this function:

Member Data Documentation

const RelAlgNode* RexInput::node_
mutableprivate

Definition at line 372 of file RelAlgDag.h.

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


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