OmniSciDB  c07336695a
anonymous_namespace{RelAlgExecutor.cpp}::RexUsedInputsVisitor Class Reference
+ Inheritance diagram for anonymous_namespace{RelAlgExecutor.cpp}::RexUsedInputsVisitor:
+ Collaboration diagram for anonymous_namespace{RelAlgExecutor.cpp}::RexUsedInputsVisitor:

Public Member Functions

 RexUsedInputsVisitor (const Catalog_Namespace::Catalog &cat)
 
const std::vector< std::shared_ptr< RexInput > > & get_inputs_owned () const
 
std::unordered_set< const RexInput * > visitInput (const RexInput *rex_input) const override
 
- Public Member Functions inherited from RexVisitor< std::unordered_set< const RexInput *> >
std::unordered_set< const RexInput * > visitInput (const RexInput *) const override
 
std::unordered_set< const RexInput * > visitLiteral (const RexLiteral *) const override
 
std::unordered_set< const RexInput * > visitSubQuery (const RexSubQuery *) const override
 
std::unordered_set< const RexInput * > visitRef (const RexRef *) const override
 
std::unordered_set< const RexInput * > visitOperator (const RexOperator *rex_operator) const override
 
std::unordered_set< const RexInput * > visitCase (const RexCase *rex_case) const override
 
- Public Member Functions inherited from RexVisitorBase< std::unordered_set< const RexInput * > >
virtual std::unordered_set< const RexInput *> visit (const RexScalar *rex_scalar) const
 

Protected Member Functions

std::unordered_set< const RexInput * > aggregateResult (const std::unordered_set< const RexInput *> &aggregate, const std::unordered_set< const RexInput *> &next_result) const override
 
- Protected Member Functions inherited from RexVisitor< std::unordered_set< const RexInput *> >
std::unordered_set< const RexInput * > defaultResult () const override
 

Private Attributes

std::vector< std::shared_ptr< RexInput > > synthesized_physical_inputs_owned
 
const Catalog_Namespace::Catalogcat_
 

Detailed Description

Definition at line 485 of file RelAlgExecutor.cpp.

Constructor & Destructor Documentation

◆ RexUsedInputsVisitor()

anonymous_namespace{RelAlgExecutor.cpp}::RexUsedInputsVisitor::RexUsedInputsVisitor ( const Catalog_Namespace::Catalog cat)
inline

Definition at line 487 of file RelAlgExecutor.cpp.

Member Function Documentation

◆ aggregateResult()

std::unordered_set<const RexInput*> anonymous_namespace{RelAlgExecutor.cpp}::RexUsedInputsVisitor::aggregateResult ( const std::unordered_set< const RexInput *> &  aggregate,
const std::unordered_set< const RexInput *> &  next_result 
) const
inlineoverrideprotectedvirtual

Reimplemented from RexVisitor< std::unordered_set< const RexInput *> >.

Definition at line 519 of file RelAlgExecutor.cpp.

References run-benchmark-import::result.

521  {
522  auto result = aggregate;
523  result.insert(next_result.begin(), next_result.end());
524  return result;
525  }

◆ get_inputs_owned()

const std::vector<std::shared_ptr<RexInput> >& anonymous_namespace{RelAlgExecutor.cpp}::RexUsedInputsVisitor::get_inputs_owned ( ) const
inline

Definition at line 489 of file RelAlgExecutor.cpp.

Referenced by anonymous_namespace{RelAlgExecutor.cpp}::get_join_source_used_inputs(), and anonymous_namespace{RelAlgExecutor.cpp}::get_used_inputs().

489  {
491  }
std::vector< std::shared_ptr< RexInput > > synthesized_physical_inputs_owned
+ Here is the caller graph for this function:

◆ visitInput()

std::unordered_set<const RexInput*> anonymous_namespace{RelAlgExecutor.cpp}::RexUsedInputsVisitor::visitInput ( const RexInput rex_input) const
inlineoverridevirtual

Implements RexVisitorBase< std::unordered_set< const RexInput * > >.

Definition at line 493 of file RelAlgExecutor.cpp.

References CHECK, RexAbstractInput::getIndex(), RexInput::getSourceNode(), RelScan::getTableDescriptor(), IS_GEO, and SPIMAP_GEO_PHYSICAL_INPUT.

494  {
495  const auto input_ra = rex_input->getSourceNode();
496  const auto scan_ra = dynamic_cast<const RelScan*>(input_ra);
497  if (scan_ra) {
498  const auto td = scan_ra->getTableDescriptor();
499  if (td) {
500  const auto col_id = rex_input->getIndex();
501  const auto cd = cat_.getMetadataForColumnBySpi(td->tableId, col_id + 1);
502  if (cd && cd->columnType.get_physical_cols() > 0) {
503  CHECK(IS_GEO(cd->columnType.get_type()));
504  std::unordered_set<const RexInput*> synthesized_physical_inputs;
505  for (auto i = 0; i < cd->columnType.get_physical_cols(); i++) {
506  auto physical_input =
507  new RexInput(scan_ra, SPIMAP_GEO_PHYSICAL_INPUT(col_id, i));
508  synthesized_physical_inputs_owned.emplace_back(physical_input);
509  synthesized_physical_inputs.insert(physical_input);
510  }
511  return synthesized_physical_inputs;
512  }
513  }
514  }
515  return {rex_input};
516  }
const TableDescriptor * getTableDescriptor() const
#define SPIMAP_GEO_PHYSICAL_INPUT(c, i)
Definition: Catalog.h:70
const RelAlgNode * getSourceNode() const
std::vector< std::shared_ptr< RexInput > > synthesized_physical_inputs_owned
const ColumnDescriptor * getMetadataForColumnBySpi(const int tableId, const size_t spi) const
Definition: Catalog.cpp:1435
#define CHECK(condition)
Definition: Logger.h:187
#define IS_GEO(T)
Definition: sqltypes.h:165
+ Here is the call graph for this function:

Member Data Documentation

◆ cat_

const Catalog_Namespace::Catalog& anonymous_namespace{RelAlgExecutor.cpp}::RexUsedInputsVisitor::cat_
private

Definition at line 529 of file RelAlgExecutor.cpp.

◆ synthesized_physical_inputs_owned

std::vector<std::shared_ptr<RexInput> > anonymous_namespace{RelAlgExecutor.cpp}::RexUsedInputsVisitor::synthesized_physical_inputs_owned
mutableprivate

Definition at line 528 of file RelAlgExecutor.cpp.


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