OmniSciDB  a987f07e93
 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)
 
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 ()
 
 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_
 

Friends

struct RelAlgDagSerializer
 

Additional Inherited Members

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

Detailed Description

Definition at line 381 of file RelAlgDag.h.

Constructor & Destructor Documentation

RexInput::RexInput ( )
inline

Definition at line 384 of file RelAlgDag.h.

Referenced by toHash().

384 : node_{nullptr} {}
const RelAlgNode * node_
Definition: RelAlgDag.h:410

+ Here is the caller graph for this function:

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

Definition at line 386 of file RelAlgDag.h.

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

Member Function Documentation

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

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

405  {
406  return std::make_unique<RexInput>(node_, getIndex());
407  }
unsigned getIndex() const
Definition: RelAlgDag.h:77
const RelAlgNode * node_
Definition: RelAlgDag.h:410

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

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

396  {
397  return getSourceNode() == that.getSourceNode() && getIndex() == that.getIndex();
398  }
unsigned getIndex() const
Definition: RelAlgDag.h:77
const RelAlgNode * getSourceNode() const
Definition: RelAlgDag.h:389

+ Here is the call graph for this function:

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

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

394 { node_ = node; }
const RelAlgNode * node_
Definition: RelAlgDag.h:410

+ Here is the caller graph for this function:

size_t RexInput::toHash ( ) const
overridevirtual

Reimplemented from RexAbstractInput.

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

3395  {
3396  if (!hash_) {
3397  hash_ = typeid(RexInput).hash_code();
3398  boost::hash_combine(*hash_, node_->toHash());
3399  boost::hash_combine(*hash_, getIndex());
3400  }
3401  return *hash_;
3402 }
RexInput()
Definition: RelAlgDag.h:384
unsigned getIndex() const
Definition: RelAlgDag.h:77
std::optional< size_t > hash_
Definition: RelAlgDag.h:62
const RelAlgNode * node_
Definition: RelAlgDag.h:410
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 3380 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().

3380  {
3381  const auto scan_node = dynamic_cast<const RelScan*>(node_);
3382  if (scan_node) {
3383  auto field_name = scan_node->getFieldName(getIndex());
3384  auto table_name = scan_node->getTableDescriptor()->tableName;
3385  return ::typeName(this) + "(" + table_name + "." + field_name + ")";
3386  }
3387  auto node_id_in_plan = node_->getIdInPlanTree();
3388  auto node_id_str =
3389  node_id_in_plan ? std::to_string(*node_id_in_plan) : std::to_string(node_->getId());
3390  auto node_str = config.skip_input_nodes ? "(input_node_id=" + node_id_str
3391  : "(input_node=" + node_->toString(config);
3392  return cat(::typeName(this), node_str, ", in_index=", std::to_string(getIndex()), ")");
3393 }
std::string cat(Ts &&...args)
std::optional< size_t > getIdInPlanTree() const
Definition: RelAlgDag.h:884
std::string to_string(char const *&&v)
const std::string getFieldName(const size_t i) const
Definition: RelAlgDag.h:990
virtual std::string toString(RelRexToStringConfig config) const =0
unsigned getIndex() const
Definition: RelAlgDag.h:77
const RelAlgNode * node_
Definition: RelAlgDag.h:410
std::string typeName(const T *v)
Definition: toString.h:103

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend struct RelAlgDagSerializer
friend

Definition at line 412 of file RelAlgDag.h.

Member Data Documentation

const RelAlgNode* RexInput::node_
mutableprivate

Definition at line 410 of file RelAlgDag.h.

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


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