OmniSciDB  2e3a973ef4
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 743 of file RelAlgExecutor.cpp.

Constructor & Destructor Documentation

◆ RexUsedInputsVisitor()

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

Definition at line 745 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 778 of file RelAlgExecutor.cpp.

References run_benchmark_import::result.

780  {
781  auto result = aggregate;
782  result.insert(next_result.begin(), next_result.end());
783  return result;
784  }

◆ get_inputs_owned()

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

Definition at line 747 of file RelAlgExecutor.cpp.

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

747  {
749  }
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 751 of file RelAlgExecutor.cpp.

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

752  {
753  const auto input_ra = rex_input->getSourceNode();
754  CHECK(input_ra);
755  const auto scan_ra = dynamic_cast<const RelScan*>(input_ra);
756  if (scan_ra) {
757  const auto td = scan_ra->getTableDescriptor();
758  if (td) {
759  const auto col_id = rex_input->getIndex();
760  const auto cd = cat_.getMetadataForColumnBySpi(td->tableId, col_id + 1);
761  if (cd && cd->columnType.get_physical_cols() > 0) {
762  CHECK(IS_GEO(cd->columnType.get_type()));
763  std::unordered_set<const RexInput*> synthesized_physical_inputs;
764  for (auto i = 0; i < cd->columnType.get_physical_cols(); i++) {
765  auto physical_input =
766  new RexInput(scan_ra, SPIMAP_GEO_PHYSICAL_INPUT(col_id, i));
767  synthesized_physical_inputs_owned.emplace_back(physical_input);
768  synthesized_physical_inputs.insert(physical_input);
769  }
770  return synthesized_physical_inputs;
771  }
772  }
773  }
774  return {rex_input};
775  }
const TableDescriptor * getTableDescriptor() const
#define SPIMAP_GEO_PHYSICAL_INPUT(c, i)
Definition: Catalog.h:74
const RelAlgNode * getSourceNode() const
std::vector< std::shared_ptr< RexInput > > synthesized_physical_inputs_owned
unsigned getIndex() const
const ColumnDescriptor * getMetadataForColumnBySpi(const int tableId, const size_t spi) const
Definition: Catalog.cpp:1547
#define CHECK(condition)
Definition: Logger.h:197
#define IS_GEO(T)
Definition: sqltypes.h:174
+ 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 788 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 787 of file RelAlgExecutor.cpp.


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