OmniSciDB  a5dc49c757
 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
 

Private Attributes

std::vector< size_t > input_size_prefix_sums_
 
const RelLeftDeepInnerJoinleft_deep_join_
 

Detailed Description

Definition at line 212 of file RelLeftDeepInnerJoin.cpp.

Constructor & Destructor Documentation

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

Definition at line 214 of file RelLeftDeepInnerJoin.cpp.

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

215  : left_deep_join_(left_deep_join) {
216  std::vector<size_t> input_sizes;
217  CHECK_GT(left_deep_join->inputCount(), size_t(1));
218  for (size_t i = 0; i < left_deep_join->inputCount(); ++i) {
219  input_sizes.push_back(left_deep_join->getInput(i)->size());
220  }
221  input_size_prefix_sums_.resize(input_sizes.size());
223  input_sizes.begin(), input_sizes.end(), input_size_prefix_sums_.begin());
224  }
#define CHECK_GT(x, y)
Definition: Logger.h:305
DEVICE void partial_sum(ARGS &&...args)
Definition: gpu_enabled.h:87
const RelAlgNode * getInput(const size_t idx) const
Definition: RelAlgDag.h:877
virtual size_t size() const =0
const size_t inputCount() const
Definition: RelAlgDag.h:875

+ Here is the call graph for this function:

Member Function Documentation

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

Definition at line 226 of file RelLeftDeepInnerJoin.cpp.

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

226  {
227  const auto source_node = rex_input->getSourceNode();
228  if (left_deep_join_->coversOriginalNode(source_node)) {
229  const auto it = std::lower_bound(input_size_prefix_sums_.begin(),
231  rex_input->getIndex(),
232  std::less_equal<size_t>());
233  CHECK(it != input_size_prefix_sums_.end());
234  const auto input_node =
235  left_deep_join_->getInput(std::distance(input_size_prefix_sums_.begin(), it));
236  if (it != input_size_prefix_sums_.begin()) {
237  const auto prev_input_count = *(it - 1);
238  CHECK_LE(prev_input_count, rex_input->getIndex());
239  const auto input_index = rex_input->getIndex() - prev_input_count;
240  rex_input->setIndex(input_index);
241  }
242  rex_input->setSourceNode(input_node);
243  }
244  return nullptr;
245  };
bool coversOriginalNode(const RelAlgNode *node) const
unsigned getIndex() const
Definition: RelAlgDag.h:174
void setIndex(const unsigned in_index) const
Definition: RelAlgDag.h:176
const RelAlgNode * getInput(const size_t idx) const
Definition: RelAlgDag.h:877
DEVICE auto lower_bound(ARGS &&...args)
Definition: gpu_enabled.h:78
#define CHECK_LE(x, y)
Definition: Logger.h:304
void setSourceNode(const RelAlgNode *node) const
Definition: RelAlgDag.h:1061
const RelAlgNode * getSourceNode() const
Definition: RelAlgDag.h:1056
#define CHECK(condition)
Definition: Logger.h:291

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

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

Definition at line 249 of file RelLeftDeepInnerJoin.cpp.


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