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

#include <RelAlgDagBuilder.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 RelAlgDagBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 348 of file RelAlgDagBuilder.h.

Referenced by toHash().

349  : RexAbstractInput(in_index), node_(node) {}
RexAbstractInput(const unsigned in_index)
const RelAlgNode * node_

+ 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 RelAlgDagBuilder.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
const RelAlgNode * node_

+ 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 RelAlgDagBuilder.h.

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

358  {
359  return getSourceNode() == that.getSourceNode() && getIndex() == that.getIndex();
360  }
unsigned getIndex() const
const RelAlgNode * getSourceNode() const

+ Here is the call graph for this function:

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

Definition at line 356 of file RelAlgDagBuilder.h.

References node_.

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

356 { node_ = node; }
const RelAlgNode * node_

+ Here is the caller graph for this function:

size_t RexInput::toHash ( ) const
overridevirtual

Reimplemented from RexAbstractInput.

Definition at line 3229 of file RelAlgDagBuilder.cpp.

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

Referenced by anonymous_namespace{RelAlgDagBuilder.cpp}::PushDownGenericExpressionInWindowFunction::visitInput().

3229  {
3230  if (!hash_) {
3231  hash_ = typeid(RexInput).hash_code();
3232  boost::hash_combine(*hash_, node_->toHash());
3233  boost::hash_combine(*hash_, getIndex());
3234  }
3235  return *hash_;
3236 }
RexInput(const RelAlgNode *node, const unsigned in_index)
unsigned getIndex() const
std::optional< size_t > hash_
const RelAlgNode * node_
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 3214 of file RelAlgDagBuilder.cpp.

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

3214  {
3215  const auto scan_node = dynamic_cast<const RelScan*>(node_);
3216  if (scan_node) {
3217  auto field_name = scan_node->getFieldName(getIndex());
3218  auto table_name = scan_node->getTableDescriptor()->tableName;
3219  return ::typeName(this) + "(" + table_name + "." + field_name + ")";
3220  }
3221  auto node_id_in_plan = node_->getIdInPlanTree();
3222  auto node_id_str =
3223  node_id_in_plan ? std::to_string(*node_id_in_plan) : std::to_string(node_->getId());
3224  auto node_str = config.skip_input_nodes ? "(input_node_id=" + node_id_str
3225  : "(input_node=" + node_->toString(config);
3226  return cat(::typeName(this), node_str, ", in_index=", std::to_string(getIndex()), ")");
3227 }
std::string cat(Ts &&...args)
std::optional< size_t > getIdInPlanTree() const
std::string to_string(char const *&&v)
const std::string getFieldName(const size_t i) const
virtual std::string toString(RelRexToStringConfig config) const =0
unsigned getIndex() const
const RelAlgNode * node_
std::string typeName(const T *v)
Definition: toString.h:102

+ Here is the call graph for this function:

Member Data Documentation

const RelAlgNode* RexInput::node_
mutableprivate

Definition at line 372 of file RelAlgDagBuilder.h.

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


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