OmniSciDB  29e35f4d58
RelJoin Class Reference

#include <RelAlgDagBuilder.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 resetQueryExecutionState ()
 
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 934 of file RelAlgDagBuilder.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 936 of file RelAlgDagBuilder.h.

940  : condition_(std::move(condition)), join_type_(join_type) {
941  inputs_.push_back(lhs);
942  inputs_.push_back(rhs);
943  }
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 318 of file RelAlgDagBuilder.cpp.

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

318  {
319  RexDeepCopyVisitor copier;
320  auto condition_copy = copier.visit(condition_.get());
321  return std::make_shared<RelJoin>(inputs_[0], inputs_[1], condition_copy, join_type_);
322 }
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 949 of file RelAlgDagBuilder.h.

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

◆ getCondition()

const RexScalar* RelJoin::getCondition ( ) const
inline

Definition at line 947 of file RelAlgDagBuilder.h.

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

947 { 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 945 of file RelAlgDagBuilder.h.

945 { 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 266 of file RelAlgDagBuilder.cpp.

References RelAlgNode::replaceInput().

Referenced by create_left_deep_join().

267  {
268  RelAlgNode::replaceInput(old_input, input);
269  RexRebindInputsVisitor rebind_inputs(old_input.get(), input.get());
270  if (condition_) {
271  rebind_inputs.visit(condition_.get());
272  }
273 }
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 951 of file RelAlgDagBuilder.h.

References CHECK.

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

◆ size()

size_t RelJoin::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 967 of file RelAlgDagBuilder.h.

967 { 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 959 of file RelAlgDagBuilder.h.

References run_benchmark_import::result, and to_string().

959  {
960  std::string result =
961  "(RelJoin<" + std::to_string(reinterpret_cast<uint64_t>(this)) + ">(";
962  result += condition_ ? condition_->toString() : "null";
963  result += " " + std::to_string(static_cast<int>(join_type_));
964  return result + ")";
965  }
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 972 of file RelAlgDagBuilder.h.

◆ join_type_

const JoinType RelJoin::join_type_
private

Definition at line 973 of file RelAlgDagBuilder.h.


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