OmniSciDB  471d68cefb
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 208 of file RelLeftDeepInnerJoin.cpp.

Constructor & Destructor Documentation

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

Definition at line 210 of file RelLeftDeepInnerJoin.cpp.

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

211  : left_deep_join_(left_deep_join) {
212  std::vector<size_t> input_sizes;
213  CHECK_GT(left_deep_join->inputCount(), size_t(1));
214  for (size_t i = 0; i < left_deep_join->inputCount(); ++i) {
215  input_sizes.push_back(left_deep_join->getInput(i)->size());
216  }
217  input_size_prefix_sums_.resize(input_sizes.size());
219  input_sizes.begin(), input_sizes.end(), input_size_prefix_sums_.begin());
220  }
#define CHECK_GT(x, y)
Definition: Logger.h:221
DEVICE void partial_sum(ARGS &&...args)
Definition: gpu_enabled.h:87
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 222 of file RelLeftDeepInnerJoin.cpp.

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

222  {
223  const auto source_node = rex_input->getSourceNode();
224  if (left_deep_join_->coversOriginalNode(source_node)) {
225  const auto it = std::lower_bound(input_size_prefix_sums_.begin(),
227  rex_input->getIndex(),
228  std::less_equal<size_t>());
229  CHECK(it != input_size_prefix_sums_.end());
230  const auto input_node =
231  left_deep_join_->getInput(std::distance(input_size_prefix_sums_.begin(), it));
232  if (it != input_size_prefix_sums_.begin()) {
233  const auto prev_input_count = *(it - 1);
234  CHECK_LE(prev_input_count, rex_input->getIndex());
235  const auto input_index = rex_input->getIndex() - prev_input_count;
236  rex_input->setIndex(input_index);
237  }
238  rex_input->setSourceNode(input_node);
239  }
240  return nullptr;
241  };
bool coversOriginalNode(const RelAlgNode *node) const
unsigned getIndex() const
void setIndex(const unsigned in_index) const
const RelAlgNode * getInput(const size_t idx) const
DEVICE auto lower_bound(ARGS &&...args)
Definition: gpu_enabled.h:78
#define CHECK_LE(x, y)
Definition: Logger.h:220
void setSourceNode(const RelAlgNode *node) const
const RelAlgNode * getSourceNode() const
#define CHECK(condition)
Definition: Logger.h:209

+ 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 241 of file RelLeftDeepInnerJoin.cpp.

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

Definition at line 245 of file RelLeftDeepInnerJoin.cpp.


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