OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RelAlgNode Class Referenceabstract

#include <RelAlgDagBuilder.h>

+ Inheritance diagram for RelAlgNode:

Public Member Functions

 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 ()
 
virtual std::string toString () const =0
 
virtual size_t toHash () const =0
 
virtual size_t size () const =0
 
virtual std::shared_ptr
< RelAlgNode
deepCopy () const =0
 
void clearContextData () const
 

Static Public Member Functions

static void resetRelAlgFirstId () noexcept
 

Protected Attributes

RelAlgInputs inputs_
 
const unsigned id_
 
std::optional< size_t > hash_
 

Private Attributes

const void * context_data_
 
bool is_nop_
 
std::vector< TargetMetaInfotargets_metainfo_
 
size_t dag_node_id_
 

Static Private Attributes

static thread_local unsigned crt_id_ = FIRST_RA_NODE_ID
 

Detailed Description

Definition at line 721 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

RelAlgNode::RelAlgNode ( RelAlgInputs  inputs = {})
inline

Definition at line 723 of file RelAlgDagBuilder.h.

723  {})
724  : inputs_(std::move(inputs))
725  , id_(crt_id_++)
726  , context_data_(nullptr)
727  , is_nop_(false) {}
static thread_local unsigned crt_id_
const void * context_data_
RelAlgInputs inputs_
const unsigned id_
virtual RelAlgNode::~RelAlgNode ( )
inlinevirtual

Definition at line 729 of file RelAlgDagBuilder.h.

729 {}

Member Function Documentation

void RelAlgNode::addManagedInput ( std::shared_ptr< const RelAlgNode input)
inline

Definition at line 770 of file RelAlgDagBuilder.h.

References inputs_.

Referenced by RelLeftDeepInnerJoin::RelLeftDeepInnerJoin().

770  {
771  inputs_.push_back(input);
772  }
RelAlgInputs inputs_

+ Here is the caller graph for this function:

void RelAlgNode::clearContextData ( ) const
inline

Clears the ptr to the result for this descriptor. Is only used for overriding step results in distributed mode.

Definition at line 817 of file RelAlgDagBuilder.h.

References context_data_.

817 { context_data_ = nullptr; }
const void * context_data_
virtual std::shared_ptr<RelAlgNode> RelAlgNode::deepCopy ( ) const
pure virtual
std::shared_ptr<const RelAlgNode> RelAlgNode::getAndOwnInput ( const size_t  idx) const
inline

Definition at line 765 of file RelAlgDagBuilder.h.

References CHECK_LT, and inputs_.

Referenced by get_left_deep_join_root().

765  {
766  CHECK_LT(idx, inputs_.size());
767  return inputs_[idx];
768  }
#define CHECK_LT(x, y)
Definition: Logger.h:219
RelAlgInputs inputs_

+ Here is the caller graph for this function:

const void* RelAlgNode::getContextData ( ) const
inline

Definition at line 753 of file RelAlgDagBuilder.h.

References CHECK, and context_data_.

753  {
755  return context_data_;
756  }
const void * context_data_
#define CHECK(condition)
Definition: Logger.h:209
unsigned RelAlgNode::getId ( ) const
inline

Definition at line 749 of file RelAlgDagBuilder.h.

References id_.

Referenced by RelAlgExecutor::executeRelAlgStep(), RelAlgExecutor::executeSort(), QueryPlanDagExtractor::handleLeftDeepJoinTree(), anonymous_namespace{RelAlgExecutor.cpp}::table_id_from_ra(), anonymous_namespace{RelAlgExecutor.cpp}::target_exprs_for_union(), and anonymous_namespace{RelAlgExecutor.cpp}::RelLeftDeepTreeIdsCollector::visitLeftDeepInnerJoin().

749 { return id_; }
const unsigned id_

+ Here is the caller graph for this function:

const RelAlgNode* RelAlgNode::getInput ( const size_t  idx) const
inline

Definition at line 760 of file RelAlgDagBuilder.h.

References CHECK_LT, and inputs_.

Referenced by anonymous_namespace{RelAlgOptimizer.cpp}::add_new_indices_for(), anonymous_namespace{RelAlgExecutor.cpp}::check_sort_node_source_constraint(), RelLogicalUnion::copyAndRedirectSource(), RelAlgExecutor::createAggregateWorkUnit(), RelAlgExecutor::createCompoundWorkUnit(), RelAlgExecutor::createProjectWorkUnit(), RelAlgExecutor::createSortInputWorkUnit(), RelAlgExecutor::createUnionWorkUnit(), RelAlgExecutor::executeProject(), RelAlgExecutor::executeSort(), RelAlgExecutor::executeUnion(), QueryPlanDagExtractor::extractQueryPlanDagImpl(), anonymous_namespace{RelAlgOptimizer.cpp}::get_actual_source_size(), anonymous_namespace{RelAlgExecutor.cpp}::get_data_sink(), anonymous_namespace{RelAlgOptimizer.cpp}::get_field_name(), anonymous_namespace{QueryPlanDagExtractor.cpp}::get_input_idx(), anonymous_namespace{RelAlgExecutor.cpp}::get_left_deep_join_input_sizes(), anonymous_namespace{RelAlgExecutor.cpp}::get_targets_meta(), anonymous_namespace{RelAlgExecutor.cpp}::get_used_inputs(), anonymous_namespace{RelAlgOptimizer.cpp}::get_visible_projects(), RelAlgExecutor::getRelAlgTranslator(), QueryPlanDagExtractor::handleLeftDeepJoinTree(), anonymous_namespace{RelAlgOptimizer.cpp}::AvailabilityChecker::hasAllSrcReady(), hoist_filter_cond_to_cross_join(), anonymous_namespace{RelAlgOptimizer.cpp}::is_distinct(), RelProject::isIdentity(), anonymous_namespace{RelAlgDagBuilder.cpp}::isRenamedInput(), project_separates_sort(), anonymous_namespace{RelAlgOptimizer.cpp}::propagate_rex_input_renumber(), anonymous_namespace{RelLeftDeepInnerJoin.cpp}::RebindRexInputsFromLeftDeepJoin::RebindRexInputsFromLeftDeepJoin(), anonymous_namespace{RelAlgExecutor.cpp}::synthesize_inputs(), tree_string(), RelAlgVisitor< std::vector< unsigned > >::visit(), RelRexDagVisitor::visit(), QueryPlanDagExtractor::visit(), JoinTargetRebaser::visitInput(), and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitSort().

760  {
761  CHECK_LT(idx, inputs_.size());
762  return inputs_[idx].get();
763  }
#define CHECK_LT(x, y)
Definition: Logger.h:219
RelAlgInputs inputs_

+ Here is the caller graph for this function:

const std::vector<TargetMetaInfo>& RelAlgNode::getOutputMetainfo ( ) const
inline
size_t RelAlgNode::getRelNodeDagId ( ) const
inline

Definition at line 796 of file RelAlgDagBuilder.h.

References dag_node_id_.

Referenced by QueryPlanDagExtractor::registerNodeToDagCache().

796 { return dag_node_id_; }
size_t dag_node_id_

+ Here is the caller graph for this function:

bool RelAlgNode::hasContextData ( ) const
inline

Definition at line 751 of file RelAlgDagBuilder.h.

References context_data_.

751 { return !(context_data_ == nullptr); }
const void * context_data_
bool RelAlgNode::hasInput ( const RelAlgNode needle) const
inline

Definition at line 774 of file RelAlgDagBuilder.h.

References inputs_.

Referenced by RelAlgExecutor::executeUnion().

774  {
775  for (auto& input_ptr : inputs_) {
776  if (input_ptr.get() == needle) {
777  return true;
778  }
779  }
780  return false;
781  }
RelAlgInputs inputs_

+ Here is the caller graph for this function:

const size_t RelAlgNode::inputCount ( ) const
inline

Definition at line 758 of file RelAlgDagBuilder.h.

References inputs_.

Referenced by anonymous_namespace{RelAlgOptimizer.cpp}::add_new_indices_for(), anonymous_namespace{RelAlgExecutor.cpp}::check_sort_node_source_constraint(), RelAlgExecutor::createAggregateWorkUnit(), RelAlgExecutor::createCompoundWorkUnit(), RelAlgExecutor::createFilterWorkUnit(), RelAlgExecutor::executeProject(), QueryPlanDagExtractor::extractQueryPlanDagImpl(), anonymous_namespace{RelAlgExecutor.cpp}::get_data_sink(), anonymous_namespace{QueryPlanDagExtractor.cpp}::get_input_idx(), anonymous_namespace{RelAlgExecutor.cpp}::get_join_source_used_inputs(), anonymous_namespace{RelAlgExecutor.cpp}::get_left_deep_join_input_sizes(), anonymous_namespace{RelAlgExecutor.cpp}::get_used_inputs(), anonymous_namespace{RelAlgOptimizer.cpp}::AvailabilityChecker::hasAllSrcReady(), anonymous_namespace{RelAlgOptimizer.cpp}::is_distinct(), RelProject::isIdentity(), anonymous_namespace{RelAlgExecutor.cpp}::left_deep_join_types(), project_separates_sort(), anonymous_namespace{RelLeftDeepInnerJoin.cpp}::RebindRexInputsFromLeftDeepJoin::RebindRexInputsFromLeftDeepJoin(), anonymous_namespace{RelAlgExecutor.cpp}::synthesize_inputs(), tree_string(), RelAlgVisitor< std::vector< unsigned > >::visit(), RelRexDagVisitor::visit(), QueryPlanDagExtractor::visit(), anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitLeftDeepInnerJoin(), and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitSort().

758 { return inputs_.size(); }
RelAlgInputs inputs_

+ Here is the caller graph for this function:

bool RelAlgNode::isNop ( ) const
inline

Definition at line 798 of file RelAlgDagBuilder.h.

References is_nop_.

798 { return is_nop_; }
void RelAlgNode::markAsNop ( )
inline

Definition at line 800 of file RelAlgDagBuilder.h.

References is_nop_.

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

800 { is_nop_ = true; }

+ Here is the caller graph for this function:

virtual void RelAlgNode::replaceInput ( std::shared_ptr< const RelAlgNode old_input,
std::shared_ptr< const RelAlgNode input 
)
inlinevirtual

Reimplemented in RelTableFunction, RelCompound, RelFilter, RelTranslatedJoin, RelJoin, and RelProject.

Definition at line 783 of file RelAlgDagBuilder.h.

References inputs_.

Referenced by RelProject::replaceInput(), RelJoin::replaceInput(), RelFilter::replaceInput(), RelCompound::replaceInput(), RelTableFunction::replaceInput(), simplify_sort(), and anonymous_namespace{RelAlgOptimizer.cpp}::try_insert_coalesceable_proj().

784  {
785  for (auto& input_ptr : inputs_) {
786  if (input_ptr == old_input) {
787  input_ptr = input;
788  break;
789  }
790  }
791  }
RelAlgInputs inputs_

+ Here is the caller graph for this function:

void RelAlgNode::resetQueryExecutionState ( )
inline

Definition at line 731 of file RelAlgDagBuilder.h.

References context_data_, and targets_metainfo_.

731  {
732  context_data_ = nullptr;
733  targets_metainfo_ = {};
734  }
const void * context_data_
std::vector< TargetMetaInfo > targets_metainfo_
void RelAlgNode::resetRelAlgFirstId ( )
staticnoexcept

Definition at line 47 of file RelAlgDagBuilder.cpp.

References crt_id_, and anonymous_namespace{RelAlgDagBuilder.cpp}::FIRST_RA_NODE_ID.

Referenced by RelAlgDagBuilder::RelAlgDagBuilder().

47  {
49 }
static thread_local unsigned crt_id_

+ Here is the caller graph for this function:

void RelAlgNode::setContextData ( const void *  context_data) const
inline

Definition at line 736 of file RelAlgDagBuilder.h.

References CHECK, and context_data_.

736  {
738  context_data_ = context_data;
739  }
const void * context_data_
#define CHECK(condition)
Definition: Logger.h:209
void RelAlgNode::setOutputMetainfo ( const std::vector< TargetMetaInfo > &  targets_metainfo) const
inline

Definition at line 741 of file RelAlgDagBuilder.h.

References targets_metainfo_.

Referenced by RelAlgExecutor::createAggregateWorkUnit(), RelAlgExecutor::createCompoundWorkUnit(), RelAlgExecutor::createFilterWorkUnit(), RelAlgExecutor::createProjectWorkUnit(), RelAlgExecutor::createSortInputWorkUnit(), RelAlgExecutor::createTableFunctionWorkUnit(), RelAlgExecutor::createUnionWorkUnit(), RelAlgExecutor::executeLogicalValues(), RelAlgExecutor::executeSort(), and RelAlgExecutor::executeUnion().

741  {
742  targets_metainfo_ = targets_metainfo;
743  }
std::vector< TargetMetaInfo > targets_metainfo_

+ Here is the caller graph for this function:

void RelAlgNode::setRelNodeDagId ( const size_t  id) const
inline

Definition at line 794 of file RelAlgDagBuilder.h.

References dag_node_id_.

Referenced by QueryPlanDagExtractor::extractQueryPlanDagImpl(), and QueryPlanDagExtractor::validateNodeId().

794 { dag_node_id_ = id; }
size_t dag_node_id_

+ Here is the caller graph for this function:

virtual size_t RelAlgNode::toHash ( ) const
pure virtual

Implemented in RelLogicalUnion, RelLogicalValues, RelTableFunction, RelModify, RelSort, RelCompound, RelLeftDeepInnerJoin, RelFilter, RelTranslatedJoin, RelJoin, RelAggregate, RelProject, and RelScan.

Referenced by QueryPlanDagCache::addNodeIfAbsent(), RelAlgDagBuilder::getQueryHint(), RexInput::toHash(), and RelTranslatedJoin::toHash().

+ Here is the caller graph for this function:

Member Data Documentation

const void* RelAlgNode::context_data_
mutableprivate
thread_local unsigned RelAlgNode::crt_id_ = FIRST_RA_NODE_ID
staticprivate

Definition at line 828 of file RelAlgDagBuilder.h.

Referenced by resetRelAlgFirstId().

size_t RelAlgNode::dag_node_id_
mutableprivate

Definition at line 829 of file RelAlgDagBuilder.h.

Referenced by getRelNodeDagId(), and setRelNodeDagId().

const unsigned RelAlgNode::id_
protected

Definition at line 821 of file RelAlgDagBuilder.h.

Referenced by getId().

bool RelAlgNode::is_nop_
private

Definition at line 826 of file RelAlgDagBuilder.h.

Referenced by isNop(), and markAsNop().

std::vector<TargetMetaInfo> RelAlgNode::targets_metainfo_
mutableprivate

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