OmniSciDB  a987f07e93
 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 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:301
DEVICE void partial_sum(ARGS &&...args)
Definition: gpu_enabled.h:87
const RelAlgNode * getInput(const size_t idx) const
Definition: RelAlgDag.h:892
virtual size_t size() const =0
const size_t inputCount() const
Definition: RelAlgDag.h:890

+ 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 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
Definition: RelAlgDag.h:77
void setIndex(const unsigned in_index) const
Definition: RelAlgDag.h:79
const RelAlgNode * getInput(const size_t idx) const
Definition: RelAlgDag.h:892
DEVICE auto lower_bound(ARGS &&...args)
Definition: gpu_enabled.h:78
#define CHECK_LE(x, y)
Definition: Logger.h:300
void setSourceNode(const RelAlgNode *node) const
Definition: RelAlgDag.h:394
const RelAlgNode * getSourceNode() const
Definition: RelAlgDag.h:389
#define CHECK(condition)
Definition: Logger.h:289

+ 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: