OmniSciDB  8fa3bf436f
 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 ExplainedQueryHint &hint_explained)
 
const bool hasHintEnabled (const QueryHint candidate_hint) const
 
const ExplainedQueryHintgetHintInfo (QueryHint hint) const
 
bool hasDeliveredHint ()
 
HintsgetDeliveredHints ()
 
- 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 718 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 720 of file RelAlgDagBuilder.h.

721  : td_(td)
722  , field_names_(field_names)
723  , hint_applied_(false)
724  , 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 ExplainedQueryHint hint_explained)
inline

Definition at line 744 of file RelAlgDagBuilder.h.

References ExplainedQueryHint::getHint(), hint_applied_, and hints_.

744  {
745  if (!hint_applied_) {
746  hint_applied_ = true;
747  }
748  hints_->emplace(hint_explained.getHint(), hint_explained);
749  }
std::unique_ptr< Hints > hints_
bool hint_applied_
const QueryHint getHint() const
Definition: QueryHint.h:104

+ Here is the call graph for this function:

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

Implements RelAlgNode.

Definition at line 739 of file RelAlgDagBuilder.h.

References CHECK.

739  {
740  CHECK(false);
741  return nullptr;
742  };
#define CHECK(condition)
Definition: Logger.h:203
Hints* RelScan::getDeliveredHints ( )
inline

Definition at line 767 of file RelAlgDagBuilder.h.

References hints_.

Referenced by anonymous_namespace{RelAlgDagBuilder.cpp}::handleQueryHint().

767 { return hints_.get(); }
std::unique_ptr< Hints > hints_

+ Here is the caller graph for this function:

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

Definition at line 732 of file RelAlgDagBuilder.h.

References field_names_, and i.

Referenced by RexInput::toString().

732 { 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 730 of file RelAlgDagBuilder.h.

References field_names_.

730 { return field_names_; }
const std::vector< std::string > field_names_
const ExplainedQueryHint& RelScan::getHintInfo ( QueryHint  hint) const
inline

Definition at line 758 of file RelAlgDagBuilder.h.

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

758  {
760  CHECK(!hints_->empty());
761  CHECK(hasHintEnabled(hint));
762  return hints_->at(hint);
763  }
const bool hasHintEnabled(const QueryHint candidate_hint) const
std::unique_ptr< Hints > hints_
bool hint_applied_
#define CHECK(condition)
Definition: Logger.h:203

+ Here is the call graph for this function:

const TableDescriptor* RelScan::getTableDescriptor ( ) const
inline

Definition at line 728 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().

728 { return td_; }
const TableDescriptor * td_

+ Here is the caller graph for this function:

bool RelScan::hasDeliveredHint ( )
inline

Definition at line 765 of file RelAlgDagBuilder.h.

References hints_.

765 { return !hints_->empty(); }
std::unique_ptr< Hints > hints_
const bool RelScan::hasHintEnabled ( const QueryHint  candidate_hint) const
inline

Definition at line 751 of file RelAlgDagBuilder.h.

References hint_applied_, and hints_.

Referenced by getHintInfo().

751  {
752  if (hint_applied_ && !hints_->empty()) {
753  return hints_->find(candidate_hint) != hints_->end();
754  }
755  return false;
756  }
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 726 of file RelAlgDagBuilder.h.

References field_names_.

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

Implements RelAlgNode.

Definition at line 734 of file RelAlgDagBuilder.h.

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

734  {
735  return cat(
736  ::typeName(this), "(", td_->tableName, ", ", ::toString(field_names_), ")");
737  }
std::string cat(Ts &&...args)
std::string tableName
const TableDescriptor * td_
std::string typeName(const T *v)
Definition: toString.h:82
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 771 of file RelAlgDagBuilder.h.

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

bool RelScan::hint_applied_
private

Definition at line 772 of file RelAlgDagBuilder.h.

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

std::unique_ptr<Hints> RelScan::hints_
private
const TableDescriptor* RelScan::td_
private

Definition at line 770 of file RelAlgDagBuilder.h.

Referenced by getTableDescriptor(), and toString().


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