OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 size_t getNumFragments () const
 
const size_t getNumShards () const
 
const std::vector< std::string > & getFieldNames () const
 
const std::string getFieldName (const size_t i) const
 
std::string toString () const override
 
size_t toHash () 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)
 
void setRelNodeDagId (const size_t id) const
 
size_t getRelNodeDagId () const
 
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_
 
std::optional< size_t > hash_
 

Detailed Description

Definition at line 832 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 834 of file RelAlgDagBuilder.h.

Referenced by toHash().

835  : td_(td)
836  , field_names_(field_names)
837  , hint_applied_(false)
838  , hints_(std::make_unique<Hints>()) {}
const TableDescriptor * td_
std::unique_ptr< Hints > hints_
bool hint_applied_
const std::vector< std::string > field_names_

+ Here is the caller graph for this function:

Member Function Documentation

void RelScan::addHint ( const ExplainedQueryHint hint_explained)
inline

Definition at line 872 of file RelAlgDagBuilder.h.

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

872  {
873  if (!hint_applied_) {
874  hint_applied_ = true;
875  }
876  hints_->emplace(hint_explained.getHint(), hint_explained);
877  }
std::unique_ptr< Hints > hints_
bool hint_applied_
const QueryHint getHint() const
Definition: QueryHint.h:108

+ Here is the call graph for this function:

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

Implements RelAlgNode.

Definition at line 867 of file RelAlgDagBuilder.h.

References CHECK.

867  {
868  CHECK(false);
869  return nullptr;
870  };
#define CHECK(condition)
Definition: Logger.h:209
Hints* RelScan::getDeliveredHints ( )
inline

Definition at line 895 of file RelAlgDagBuilder.h.

References hints_.

895 { return hints_.get(); }
std::unique_ptr< Hints > hints_
const std::string RelScan::getFieldName ( const size_t  i) const
inline

Definition at line 850 of file RelAlgDagBuilder.h.

References field_names_, and i.

Referenced by RexInput::toString().

850 { 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 848 of file RelAlgDagBuilder.h.

References field_names_.

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

Definition at line 886 of file RelAlgDagBuilder.h.

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

886  {
888  CHECK(!hints_->empty());
889  CHECK(hasHintEnabled(hint));
890  return hints_->at(hint);
891  }
const bool hasHintEnabled(const QueryHint candidate_hint) const
std::unique_ptr< Hints > hints_
bool hint_applied_
#define CHECK(condition)
Definition: Logger.h:209

+ Here is the call graph for this function:

const size_t RelScan::getNumFragments ( ) const
inline

Definition at line 844 of file RelAlgDagBuilder.h.

References TableDescriptor::fragmenter, and td_.

844 { return td_->fragmenter->getNumFragments(); }
const TableDescriptor * td_
std::shared_ptr< Fragmenter_Namespace::AbstractFragmenter > fragmenter
const size_t RelScan::getNumShards ( ) const
inline

Definition at line 846 of file RelAlgDagBuilder.h.

References TableDescriptor::nShards, and td_.

846 { return td_->nShards; }
const TableDescriptor * td_
const TableDescriptor* RelScan::getTableDescriptor ( ) const
inline

Definition at line 842 of file RelAlgDagBuilder.h.

References td_.

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

842 { return td_; }
const TableDescriptor * td_

+ Here is the caller graph for this function:

bool RelScan::hasDeliveredHint ( )
inline

Definition at line 893 of file RelAlgDagBuilder.h.

References hints_.

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

Definition at line 879 of file RelAlgDagBuilder.h.

References hint_applied_, and hints_.

Referenced by getHintInfo().

879  {
880  if (hint_applied_ && !hints_->empty()) {
881  return hints_->find(candidate_hint) != hints_->end();
882  }
883  return false;
884  }
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 840 of file RelAlgDagBuilder.h.

References field_names_.

840 { return field_names_.size(); }
const std::vector< std::string > field_names_
size_t RelScan::toHash ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 857 of file RelAlgDagBuilder.h.

References field_names_, RelAlgNode::hash_, RelScan(), TableDescriptor::tableId, TableDescriptor::tableName, td_, and toString().

857  {
858  if (!hash_) {
859  hash_ = typeid(RelScan).hash_code();
860  boost::hash_combine(*hash_, td_->tableId);
861  boost::hash_combine(*hash_, td_->tableName);
862  boost::hash_combine(*hash_, ::toString(field_names_));
863  }
864  return *hash_;
865  }
std::string tableName
const TableDescriptor * td_
std::optional< size_t > hash_
const std::vector< std::string > field_names_
std::string toString() const override
RelScan(const TableDescriptor *td, const std::vector< std::string > &field_names)

+ Here is the call graph for this function:

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

Implements RelAlgNode.

Definition at line 852 of file RelAlgDagBuilder.h.

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

Referenced by toHash().

852  {
853  return cat(
854  ::typeName(this), "(", td_->tableName, ", ", ::toString(field_names_), ")");
855  }
std::string cat(Ts &&...args)
std::string tableName
const TableDescriptor * td_
std::string typeName(const T *v)
Definition: toString.h:88
const std::vector< std::string > field_names_
std::string toString() const override

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 899 of file RelAlgDagBuilder.h.

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

bool RelScan::hint_applied_
private

Definition at line 900 of file RelAlgDagBuilder.h.

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

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

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