OmniSciDB  bf83d84833
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 ()
 
void clearContextData () const
 

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 796 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 798 of file RelAlgDagBuilder.h.

799  : td_(td)
800  , field_names_(field_names)
801  , hint_applied_(false)
802  , 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

void RelScan::addHint ( const HintExplained hint_explained)
inline

Definition at line 822 of file RelAlgDagBuilder.h.

References HintExplained::getHintName(), hint_applied_, and hints_.

822  {
823  if (!hint_applied_) {
824  hint_applied_ = true;
825  }
826  hints_->emplace(hint_explained.getHintName(), hint_explained);
827  }
const std::string & getHintName() const
std::unique_ptr< Hints > hints_
bool hint_applied_

+ Here is the call graph for this function:

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

Implements RelAlgNode.

Definition at line 817 of file RelAlgDagBuilder.h.

References CHECK.

817  {
818  CHECK(false);
819  return nullptr;
820  };
#define CHECK(condition)
Definition: Logger.h:197
const std::string RelScan::getFieldName ( const size_t  i) const
inline

Definition at line 810 of file RelAlgDagBuilder.h.

References field_names_.

Referenced by RexInput::toString().

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

+ Here is the caller graph for this function:

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

Definition at line 808 of file RelAlgDagBuilder.h.

References field_names_.

808 { return field_names_; }
const std::vector< std::string > field_names_
const HintExplained& RelScan::getHintInfo ( const std::string &  hint_name) const
inline

Definition at line 836 of file RelAlgDagBuilder.h.

References CHECK, hasHintEnabled(), hint_applied_, and hints_.

836  {
838  CHECK(!hints_->empty());
839  CHECK(hasHintEnabled(hint_name));
840  return hints_->at(hint_name);
841  }
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

+ Here is the call graph for this function:

const TableDescriptor* RelScan::getTableDescriptor ( ) const
inline

Definition at line 806 of file RelAlgDagBuilder.h.

References td_.

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

806 { return td_; }
const TableDescriptor * td_

+ Here is the caller graph for this function:

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

Definition at line 829 of file RelAlgDagBuilder.h.

References hint_applied_, and hints_.

Referenced by getHintInfo().

829  {
830  if (hint_applied_ && !hints_->empty()) {
831  return hints_->find(candidate_hint_name) != hints_->end();
832  }
833  return false;
834  }
std::unique_ptr< Hints > hints_
bool hint_applied_

+ Here is the caller graph for this function:

size_t RelScan::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 804 of file RelAlgDagBuilder.h.

References field_names_.

804 { return field_names_.size(); }
const std::vector< std::string > field_names_
std::string RelScan::toString ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 812 of file RelAlgDagBuilder.h.

References cat(), field_names_, TableDescriptor::tableName, and td_.

812  {
813  return cat(
814  ::typeName(this), "(", td_->tableName, ", ", ::toString(field_names_), ")");
815  }
std::string cat(Ts &&...args)
std::string tableName
const TableDescriptor * td_
const std::vector< std::string > field_names_
std::string toString() const override

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 845 of file RelAlgDagBuilder.h.

Referenced by getFieldName(), getFieldNames(), size(), and toString().

bool RelScan::hint_applied_
private

Definition at line 846 of file RelAlgDagBuilder.h.

Referenced by addHint(), getHintInfo(), and hasHintEnabled().

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

Definition at line 847 of file RelAlgDagBuilder.h.

Referenced by addHint(), getHintInfo(), and hasHintEnabled().

const TableDescriptor* RelScan::td_
private

Definition at line 844 of file RelAlgDagBuilder.h.

Referenced by getTableDescriptor(), and toString().


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