OmniSciDB  cde582ebc3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RelScan Class Reference

#include <RelAlgDag.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 (RelRexToStringConfig config=RelRexToStringConfig::defaults()) 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 RaExecutionDesc *context_data) const
 
void setOutputMetainfo (const std::vector< TargetMetaInfo > &targets_metainfo) const
 
void setQueryPlanDag (const std::string &extracted_query_plan_dag) const
 
std::string getQueryPlanDag () const
 
size_t getQueryPlanDagHash () const
 
const std::vector
< TargetMetaInfo > & 
getOutputMetainfo () const
 
unsigned getId () const
 
void setIdInPlanTree (size_t id) const
 
std::optional< size_t > getIdInPlanTree () const
 
bool hasContextData () const
 
const RaExecutionDescgetContextData () 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 > id_in_plan_tree_
 
std::optional< size_t > hash_
 

Detailed Description

Definition at line 901 of file RelAlgDag.h.

Constructor & Destructor Documentation

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

Definition at line 903 of file RelAlgDag.h.

Referenced by toHash().

904  : td_(td)
905  , field_names_(field_names)
906  , hint_applied_(false)
907  , hints_(std::make_unique<Hints>()) {}
const TableDescriptor * td_
Definition: RelAlgDag.h:968
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:971
bool hint_applied_
Definition: RelAlgDag.h:970
const std::vector< std::string > field_names_
Definition: RelAlgDag.h:969

+ Here is the caller graph for this function:

Member Function Documentation

void RelScan::addHint ( const ExplainedQueryHint hint_explained)
inline

Definition at line 942 of file RelAlgDag.h.

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

942  {
943  if (!hint_applied_) {
944  hint_applied_ = true;
945  }
946  hints_->emplace(hint_explained.getHint(), hint_explained);
947  }
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:971
bool hint_applied_
Definition: RelAlgDag.h:970
const QueryHint getHint() const
Definition: QueryHint.h:123

+ Here is the call graph for this function:

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

Implements RelAlgNode.

Definition at line 937 of file RelAlgDag.h.

References CHECK.

937  {
938  CHECK(false);
939  return nullptr;
940  };
#define CHECK(condition)
Definition: Logger.h:222
Hints* RelScan::getDeliveredHints ( )
inline

Definition at line 965 of file RelAlgDag.h.

References hints_.

965 { return hints_.get(); }
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:971
const std::string RelScan::getFieldName ( const size_t  i) const
inline

Definition at line 919 of file RelAlgDag.h.

References field_names_.

Referenced by RexInput::toString().

919 { return field_names_[i]; }
const std::vector< std::string > field_names_
Definition: RelAlgDag.h:969

+ Here is the caller graph for this function:

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

Definition at line 917 of file RelAlgDag.h.

References field_names_.

917 { return field_names_; }
const std::vector< std::string > field_names_
Definition: RelAlgDag.h:969
const ExplainedQueryHint& RelScan::getHintInfo ( QueryHint  hint) const
inline

Definition at line 956 of file RelAlgDag.h.

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

956  {
958  CHECK(!hints_->empty());
959  CHECK(hasHintEnabled(hint));
960  return hints_->at(hint);
961  }
const bool hasHintEnabled(const QueryHint candidate_hint) const
Definition: RelAlgDag.h:949
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:971
bool hint_applied_
Definition: RelAlgDag.h:970
#define CHECK(condition)
Definition: Logger.h:222

+ Here is the call graph for this function:

const size_t RelScan::getNumFragments ( ) const
inline

Definition at line 913 of file RelAlgDag.h.

References TableDescriptor::fragmenter, and td_.

913 { return td_->fragmenter->getNumFragments(); }
const TableDescriptor * td_
Definition: RelAlgDag.h:968
std::shared_ptr< Fragmenter_Namespace::AbstractFragmenter > fragmenter
const size_t RelScan::getNumShards ( ) const
inline

Definition at line 915 of file RelAlgDag.h.

References TableDescriptor::nShards, and td_.

915 { return td_->nShards; }
const TableDescriptor * td_
Definition: RelAlgDag.h:968
const TableDescriptor* RelScan::getTableDescriptor ( ) const
inline

Definition at line 911 of file RelAlgDag.h.

References td_.

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

911 { return td_; }
const TableDescriptor * td_
Definition: RelAlgDag.h:968

+ Here is the caller graph for this function:

bool RelScan::hasDeliveredHint ( )
inline

Definition at line 963 of file RelAlgDag.h.

References hints_.

963 { return !hints_->empty(); }
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:971
const bool RelScan::hasHintEnabled ( const QueryHint  candidate_hint) const
inline

Definition at line 949 of file RelAlgDag.h.

References hint_applied_, and hints_.

Referenced by getHintInfo().

949  {
950  if (hint_applied_ && !hints_->empty()) {
951  return hints_->find(candidate_hint) != hints_->end();
952  }
953  return false;
954  }
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:971
bool hint_applied_
Definition: RelAlgDag.h:970

+ Here is the caller graph for this function:

size_t RelScan::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 909 of file RelAlgDag.h.

References field_names_.

909 { return field_names_.size(); }
const std::vector< std::string > field_names_
Definition: RelAlgDag.h:969
size_t RelScan::toHash ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 927 of file RelAlgDag.h.

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

927  {
928  if (!hash_) {
929  hash_ = typeid(RelScan).hash_code();
930  boost::hash_combine(*hash_, td_->tableId);
931  boost::hash_combine(*hash_, td_->tableName);
932  boost::hash_combine(*hash_, ::toString(field_names_));
933  }
934  return *hash_;
935  }
std::string tableName
const TableDescriptor * td_
Definition: RelAlgDag.h:968
std::optional< size_t > hash_
Definition: RelAlgDag.h:889
std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
Definition: RelAlgDag.h:921
const std::vector< std::string > field_names_
Definition: RelAlgDag.h:969
RelScan(const TableDescriptor *td, const std::vector< std::string > &field_names)
Definition: RelAlgDag.h:903

+ Here is the call graph for this function:

std::string RelScan::toString ( RelRexToStringConfig  config = RelRexToStringConfig::defaults()) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 921 of file RelAlgDag.h.

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

Referenced by toHash().

922  {
923  return cat(
924  ::typeName(this), "(", td_->tableName, ", ", ::toString(field_names_), ")");
925  }
std::string cat(Ts &&...args)
std::string tableName
const TableDescriptor * td_
Definition: RelAlgDag.h:968
std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
Definition: RelAlgDag.h:921
std::string typeName(const T *v)
Definition: toString.h:102
const std::vector< std::string > field_names_
Definition: RelAlgDag.h:969

+ 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 969 of file RelAlgDag.h.

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

bool RelScan::hint_applied_
private

Definition at line 970 of file RelAlgDag.h.

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

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

Definition at line 968 of file RelAlgDag.h.

Referenced by getNumFragments(), getNumShards(), getTableDescriptor(), toHash(), and toString().


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