OmniSciDB  04ee39c94c
RelJoin Class Reference

#include <RelAlgAbstractInterpreter.h>

+ Inheritance diagram for RelJoin:
+ Collaboration diagram for RelJoin:

Public Member Functions

 RelJoin (std::shared_ptr< const RelAlgNode > lhs, std::shared_ptr< const RelAlgNode > rhs, std::unique_ptr< const RexScalar > &condition, const JoinType join_type)
 
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::string toString () const override
 
size_t size () const override
 
std::shared_ptr< RelAlgNodedeepCopy () const override
 
- Public Member Functions inherited from RelAlgNode
 RelAlgNode ()
 
virtual ~RelAlgNode ()
 
void setContextData (const void *context_data) const
 
void setOutputMetainfo (const std::vector< TargetMetaInfo > &targets_metainfo) const
 
const std::vector< TargetMetaInfo > & getOutputMetainfo () const
 
unsigned getId () const
 
bool hasContextData () const
 
const void * getContextData () const
 
const size_t inputCount () const
 
const RelAlgNodegetInput (const size_t idx) 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
 
bool isNop () const
 
void markAsNop ()
 

Private Attributes

std::unique_ptr< const RexScalarcondition_
 
const JoinType join_type_
 

Additional Inherited Members

- Static Public Member Functions inherited from RelAlgNode
static void resetRelAlgFirstId () noexcept
 
- Protected Attributes inherited from RelAlgNode
std::vector< std::shared_ptr< const RelAlgNode > > inputs_
 
const unsigned id_
 

Detailed Description

Definition at line 932 of file RelAlgAbstractInterpreter.h.

Constructor & Destructor Documentation

◆ RelJoin()

RelJoin::RelJoin ( std::shared_ptr< const RelAlgNode lhs,
std::shared_ptr< const RelAlgNode rhs,
std::unique_ptr< const RexScalar > &  condition,
const JoinType  join_type 
)
inline

Definition at line 934 of file RelAlgAbstractInterpreter.h.

938  : condition_(std::move(condition)), join_type_(join_type) {
939  inputs_.push_back(lhs);
940  inputs_.push_back(rhs);
941  }
std::vector< std::shared_ptr< const RelAlgNode > > inputs_
std::unique_ptr< const RexScalar > condition_
const JoinType join_type_

Member Function Documentation

◆ deepCopy()

std::shared_ptr< RelAlgNode > RelJoin::deepCopy ( ) const
overridevirtual

Implements RelAlgNode.

Definition at line 305 of file RelAlgAbstractInterpreter.cpp.

References RelAlgNode::inputs_, and RexVisitorBase< T >::visit().

305  {
306  RexDeepCopyVisitor copier;
307  auto condition_copy = copier.visit(condition_.get());
308  return std::make_shared<RelJoin>(inputs_[0], inputs_[1], condition_copy, join_type_);
309 }
std::vector< std::shared_ptr< const RelAlgNode > > inputs_
std::unique_ptr< const RexScalar > condition_
const JoinType join_type_
virtual T visit(const RexScalar *rex_scalar) const
Definition: RexVisitor.h:27
+ Here is the call graph for this function:

◆ getAndReleaseCondition()

const RexScalar* RelJoin::getAndReleaseCondition ( ) const
inline

Definition at line 947 of file RelAlgAbstractInterpreter.h.

947 { return condition_.release(); }
std::unique_ptr< const RexScalar > condition_

◆ getCondition()

const RexScalar* RelJoin::getCondition ( ) const
inline

Definition at line 945 of file RelAlgAbstractInterpreter.h.

Referenced by anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitJoin().

945 { return condition_.get(); }
std::unique_ptr< const RexScalar > condition_
+ Here is the caller graph for this function:

◆ getJoinType()

JoinType RelJoin::getJoinType ( ) const
inline

Definition at line 943 of file RelAlgAbstractInterpreter.h.

943 { return join_type_; }
const JoinType join_type_

◆ replaceInput()

void RelJoin::replaceInput ( std::shared_ptr< const RelAlgNode old_input,
std::shared_ptr< const RelAlgNode input 
)
overridevirtual

Reimplemented from RelAlgNode.

Definition at line 253 of file RelAlgAbstractInterpreter.cpp.

References RelAlgNode::replaceInput().

Referenced by create_left_deep_join().

254  {
255  RelAlgNode::replaceInput(old_input, input);
256  RexRebindInputsVisitor rebind_inputs(old_input.get(), input.get());
257  if (condition_) {
258  rebind_inputs.visit(condition_.get());
259  }
260 }
std::unique_ptr< const RexScalar > condition_
virtual void replaceInput(std::shared_ptr< const RelAlgNode > old_input, std::shared_ptr< const RelAlgNode > input)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCondition()

void RelJoin::setCondition ( std::unique_ptr< const RexScalar > &  condition)
inline

Definition at line 949 of file RelAlgAbstractInterpreter.h.

References CHECK.

949  {
950  CHECK(condition);
951  condition_ = std::move(condition);
952  }
std::unique_ptr< const RexScalar > condition_
#define CHECK(condition)
Definition: Logger.h:187

◆ size()

size_t RelJoin::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 965 of file RelAlgAbstractInterpreter.h.

965 { return inputs_[0]->size() + inputs_[1]->size(); }
std::vector< std::shared_ptr< const RelAlgNode > > inputs_

◆ toString()

std::string RelJoin::toString ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 957 of file RelAlgAbstractInterpreter.h.

References run-benchmark-import::result, and to_string().

957  {
958  std::string result =
959  "(RelJoin<" + std::to_string(reinterpret_cast<uint64_t>(this)) + ">(";
960  result += condition_ ? condition_->toString() : "null";
961  result += " " + std::to_string(static_cast<int>(join_type_));
962  return result + ")";
963  }
std::unique_ptr< const RexScalar > condition_
const JoinType join_type_
std::string to_string(char const *&&v)
+ Here is the call graph for this function:

Member Data Documentation

◆ condition_

std::unique_ptr<const RexScalar> RelJoin::condition_
mutableprivate

Definition at line 970 of file RelAlgAbstractInterpreter.h.

◆ join_type_

const JoinType RelJoin::join_type_
private

Definition at line 971 of file RelAlgAbstractInterpreter.h.


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