OmniSciDB  8a228a1076
RelScan Class Reference

#include <RelAlgDagBuilder.h>

+ Inheritance diagram for RelScan:
+ Collaboration diagram for RelScan:

Public Member Functions

 RelScan (const TableDescriptor *td, const std::vector< std::string > &field_names)
 
size_t size () const override
 
const TableDescriptorgetTableDescriptor () const
 
const std::vector< std::string > & getFieldNames () const
 
const std::string getFieldName (const size_t i) const
 
std::string toString () const override
 
std::shared_ptr< RelAlgNodedeepCopy () const override
 
void addHint (const HintExplained &hint_explained)
 
const bool hasHintEnabled (const std::string &candidate_hint_name) const
 
const HintExplainedgetHintInfo (const std::string &hint_name) const
 
- Public Member Functions inherited from RelAlgNode
 RelAlgNode (RelAlgInputs inputs={})
 
virtual ~RelAlgNode ()
 
void resetQueryExecutionState ()
 
void setContextData (const void *context_data) const
 
void setOutputMetainfo (const std::vector< TargetMetaInfo > &targets_metainfo) const
 
const std::vector< TargetMetaInfo > & getOutputMetainfo () const
 
unsigned getId () const
 
bool hasContextData () const
 
const void * getContextData () const
 
const size_t inputCount () const
 
const RelAlgNodegetInput (const size_t idx) const
 
std::shared_ptr< const RelAlgNodegetAndOwnInput (const size_t idx) const
 
void addManagedInput (std::shared_ptr< const RelAlgNode > input)
 
bool hasInput (const RelAlgNode *needle) const
 
virtual void replaceInput (std::shared_ptr< const RelAlgNode > old_input, std::shared_ptr< const RelAlgNode > input)
 
bool isNop () const
 
void markAsNop ()
 

Private Attributes

const TableDescriptortd_
 
const std::vector< std::string > field_names_
 
bool hint_applied_
 
std::unique_ptr< Hintshints_
 

Additional Inherited Members

- Static Public Member Functions inherited from RelAlgNode
static void resetRelAlgFirstId () noexcept
 
- Protected Attributes inherited from RelAlgNode
RelAlgInputs inputs_
 
const unsigned id_
 

Detailed Description

Definition at line 789 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

◆ RelScan()

RelScan::RelScan ( const TableDescriptor td,
const std::vector< std::string > &  field_names 
)
inline

Definition at line 791 of file RelAlgDagBuilder.h.

792  : td_(td)
793  , field_names_(field_names)
794  , hint_applied_(false)
795  , hints_(std::make_unique<Hints>()) {}
const TableDescriptor * td_
std::unique_ptr< Hints > hints_
bool hint_applied_
const std::vector< std::string > field_names_

Member Function Documentation

◆ addHint()

void RelScan::addHint ( const HintExplained hint_explained)
inline

Definition at line 815 of file RelAlgDagBuilder.h.

References HintExplained::getHintName().

815  {
816  if (!hint_applied_) {
817  hint_applied_ = true;
818  }
819  hints_->emplace(hint_explained.getHintName(), hint_explained);
820  }
const std::string & getHintName() const
std::unique_ptr< Hints > hints_
bool hint_applied_
+ Here is the call graph for this function:

◆ deepCopy()

std::shared_ptr<RelAlgNode> RelScan::deepCopy ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 810 of file RelAlgDagBuilder.h.

References CHECK.

810  {
811  CHECK(false);
812  return nullptr;
813  };
#define CHECK(condition)
Definition: Logger.h:197

◆ getFieldName()

const std::string RelScan::getFieldName ( const size_t  i) const
inline

Definition at line 803 of file RelAlgDagBuilder.h.

803 { return field_names_[i]; }
const std::vector< std::string > field_names_

◆ getFieldNames()

const std::vector<std::string>& RelScan::getFieldNames ( ) const
inline

Definition at line 801 of file RelAlgDagBuilder.h.

801 { return field_names_; }
const std::vector< std::string > field_names_

◆ getHintInfo()

const HintExplained& RelScan::getHintInfo ( const std::string &  hint_name) const
inline

Definition at line 829 of file RelAlgDagBuilder.h.

References CHECK.

829  {
831  CHECK(!hints_->empty());
832  CHECK(hasHintEnabled(hint_name));
833  return hints_->at(hint_name);
834  }
std::unique_ptr< Hints > hints_
bool hint_applied_
#define CHECK(condition)
Definition: Logger.h:197
const bool hasHintEnabled(const std::string &candidate_hint_name) const

◆ getTableDescriptor()

const TableDescriptor* RelScan::getTableDescriptor ( ) const
inline

Definition at line 799 of file RelAlgDagBuilder.h.

Referenced by anonymous_namespace{RelAlgExecutor.cpp}::table_id_from_ra(), anonymous_namespace{RelAlgExecutor.cpp}::RexUsedInputsVisitor::visitInput(), and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalTableInputsVisitor::visitScan().

799 { return td_; }
const TableDescriptor * td_
+ Here is the caller graph for this function:

◆ hasHintEnabled()

const bool RelScan::hasHintEnabled ( const std::string &  candidate_hint_name) const
inline

Definition at line 822 of file RelAlgDagBuilder.h.

822  {
823  if (hint_applied_ && !hints_->empty()) {
824  return hints_->find(candidate_hint_name) != hints_->end();
825  }
826  return false;
827  }
std::unique_ptr< Hints > hints_
bool hint_applied_

◆ size()

size_t RelScan::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 797 of file RelAlgDagBuilder.h.

797 { return field_names_.size(); }
const std::vector< std::string > field_names_

◆ toString()

std::string RelScan::toString ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 805 of file RelAlgDagBuilder.h.

References to_string().

805  {
806  return "(RelScan<" + std::to_string(reinterpret_cast<uint64_t>(this)) + "> " +
807  td_->tableName + ")";
808  }
std::string tableName
const TableDescriptor * td_
std::string to_string(char const *&&v)
+ Here is the call graph for this function:

Member Data Documentation

◆ field_names_

const std::vector<std::string> RelScan::field_names_
private

Definition at line 838 of file RelAlgDagBuilder.h.

◆ hint_applied_

bool RelScan::hint_applied_
private

Definition at line 839 of file RelAlgDagBuilder.h.

◆ hints_

std::unique_ptr<Hints> RelScan::hints_
private

Definition at line 840 of file RelAlgDagBuilder.h.

◆ td_

const TableDescriptor* RelScan::td_
private

Definition at line 837 of file RelAlgDagBuilder.h.


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