OmniSciDB  085a039ca4
 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 219 of file RelLeftDeepInnerJoin.cpp.

Constructor & Destructor Documentation

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

Definition at line 221 of file RelLeftDeepInnerJoin.cpp.

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

222  : left_deep_join_(left_deep_join) {
223  std::vector<size_t> input_sizes;
224  CHECK_GT(left_deep_join->inputCount(), size_t(1));
225  for (size_t i = 0; i < left_deep_join->inputCount(); ++i) {
226  input_sizes.push_back(left_deep_join->getInput(i)->size());
227  }
228  input_size_prefix_sums_.resize(input_sizes.size());
230  input_sizes.begin(), input_sizes.end(), input_size_prefix_sums_.begin());
231  }
#define CHECK_GT(x, y)
Definition: Logger.h:235
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 233 of file RelLeftDeepInnerJoin.cpp.

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

233  {
234  const auto source_node = rex_input->getSourceNode();
235  if (left_deep_join_->coversOriginalNode(source_node)) {
236  const auto it = std::lower_bound(input_size_prefix_sums_.begin(),
238  rex_input->getIndex(),
239  std::less_equal<size_t>());
240  CHECK(it != input_size_prefix_sums_.end());
241  const auto input_node =
242  left_deep_join_->getInput(std::distance(input_size_prefix_sums_.begin(), it));
243  if (it != input_size_prefix_sums_.begin()) {
244  const auto prev_input_count = *(it - 1);
245  CHECK_LE(prev_input_count, rex_input->getIndex());
246  const auto input_index = rex_input->getIndex() - prev_input_count;
247  rex_input->setIndex(input_index);
248  }
249  rex_input->setSourceNode(input_node);
250  }
251  return nullptr;
252  };
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:234
void setSourceNode(const RelAlgNode *node) const
const RelAlgNode * getSourceNode() const
#define CHECK(condition)
Definition: Logger.h:223

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

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

Definition at line 256 of file RelLeftDeepInnerJoin.cpp.


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