OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{RelLeftDeepInnerJoin.cpp}::RebindRexInputsFromLeftDeepJoin Class Reference
+ Inheritance diagram for anonymous_namespace{RelLeftDeepInnerJoin.cpp}::RebindRexInputsFromLeftDeepJoin:
+ Collaboration diagram for anonymous_namespace{RelLeftDeepInnerJoin.cpp}::RebindRexInputsFromLeftDeepJoin:

Public Member Functions

 RebindRexInputsFromLeftDeepJoin (const RelLeftDeepInnerJoin *left_deep_join)
 
void * visitInput (const RexInput *rex_input) const override
 
- Public Member Functions inherited from RexVisitor< void * >
void * visitInput (const RexInput *) const override
 
void * visitLiteral (const RexLiteral *) const override
 
void * visitSubQuery (const RexSubQuery *) const override
 
void * visitRef (const RexRef *) const override
 
void * visitOperator (const RexOperator *rex_operator) const override
 
void * visitCase (const RexCase *rex_case) const override
 
- Public Member Functions inherited from RexVisitorBase< void * >
virtual void * visit (const RexScalar *rex_scalar) const
 

Private Attributes

std::vector< size_t > input_size_prefix_sums_
 
const RelLeftDeepInnerJoinleft_deep_join_
 

Additional Inherited Members

- Protected Member Functions inherited from RexVisitor< void * >
virtual void * aggregateResult (const void *&aggregate, const void *&next_result) const
 
void * defaultResult () const override
 

Detailed Description

Definition at line 179 of file RelLeftDeepInnerJoin.cpp.

Constructor & Destructor Documentation

anonymous_namespace{RelLeftDeepInnerJoin.cpp}::RebindRexInputsFromLeftDeepJoin::RebindRexInputsFromLeftDeepJoin ( const RelLeftDeepInnerJoin left_deep_join)
inline

Definition at line 181 of file RelLeftDeepInnerJoin.cpp.

References CHECK_GT, RelAlgNode::getInput(), RelAlgNode::inputCount(), and RelAlgNode::size().

182  : left_deep_join_(left_deep_join) {
183  std::vector<size_t> input_sizes;
184  CHECK_GT(left_deep_join->inputCount(), size_t(1));
185  for (size_t i = 0; i < left_deep_join->inputCount(); ++i) {
186  input_sizes.push_back(left_deep_join->getInput(i)->size());
187  }
188  input_size_prefix_sums_.resize(input_sizes.size());
189  std::partial_sum(
190  input_sizes.begin(), input_sizes.end(), input_size_prefix_sums_.begin());
191  }
#define CHECK_GT(x, y)
Definition: Logger.h:202
const RelAlgNode * getInput(const size_t idx) const
virtual size_t size() const =0
const size_t inputCount() const

+ Here is the call graph for this function:

Member Function Documentation

void* anonymous_namespace{RelLeftDeepInnerJoin.cpp}::RebindRexInputsFromLeftDeepJoin::visitInput ( const RexInput rex_input) const
inlineoverridevirtual

Implements RexVisitorBase< void * >.

Definition at line 193 of file RelLeftDeepInnerJoin.cpp.

References CHECK(), CHECK_LE, RexAbstractInput::getIndex(), RexInput::getSourceNode(), RexAbstractInput::setIndex(), and RexInput::setSourceNode().

193  {
194  const auto source_node = rex_input->getSourceNode();
195  if (left_deep_join_->coversOriginalNode(source_node)) {
196  const auto it = std::lower_bound(input_size_prefix_sums_.begin(),
198  rex_input->getIndex(),
199  std::less_equal<size_t>());
200  CHECK(it != input_size_prefix_sums_.end());
201  const auto input_node =
202  left_deep_join_->getInput(std::distance(input_size_prefix_sums_.begin(), it));
203  if (it != input_size_prefix_sums_.begin()) {
204  const auto prev_input_count = *(it - 1);
205  CHECK_LE(prev_input_count, rex_input->getIndex());
206  const auto input_index = rex_input->getIndex() - prev_input_count;
207  rex_input->setIndex(input_index);
208  }
209  rex_input->setSourceNode(input_node);
210  }
211  return nullptr;
212  };
bool coversOriginalNode(const RelAlgNode *node) const
unsigned getIndex() const
CHECK(cgen_state)
void setIndex(const unsigned in_index) const
const RelAlgNode * getInput(const size_t idx) const
#define CHECK_LE(x, y)
Definition: Logger.h:201
void setSourceNode(const RelAlgNode *node) const
const RelAlgNode * getSourceNode() const

+ Here is the call graph for this function:

Member Data Documentation

std::vector<size_t> anonymous_namespace{RelLeftDeepInnerJoin.cpp}::RebindRexInputsFromLeftDeepJoin::input_size_prefix_sums_
private

Definition at line 212 of file RelLeftDeepInnerJoin.cpp.

const RelLeftDeepInnerJoin* anonymous_namespace{RelLeftDeepInnerJoin.cpp}::RebindRexInputsFromLeftDeepJoin::left_deep_join_
private

Definition at line 216 of file RelLeftDeepInnerJoin.cpp.


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