OmniSciDB  72180abbfe
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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)
 
bool isNop () const
 
void markAsNop ()
 
virtual std::string toString () const =0
 
virtual size_t size () const =0
 
virtual std::shared_ptr
< RelAlgNode
deepCopy () const =0
 

Static Public Member Functions

static void resetRelAlgFirstId () noexcept
 

Protected Attributes

RelAlgInputs inputs_
 
const unsigned id_
 

Private Attributes

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

Static Private Attributes

static thread_local unsigned crt_id_ = FIRST_RA_NODE_ID
 

Detailed Description

Definition at line 685 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 687 of file RelAlgDagBuilder.h.

687  {})
688  : inputs_(std::move(inputs))
689  , id_(crt_id_++)
690  , context_data_(nullptr)
691  , 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 693 of file RelAlgDagBuilder.h.

693 {}

Member Function Documentation

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

Definition at line 734 of file RelAlgDagBuilder.h.

References inputs_.

Referenced by RelLeftDeepInnerJoin::RelLeftDeepInnerJoin().

734  {
735  inputs_.push_back(input);
736  }
RelAlgInputs inputs_

+ Here is the caller graph for this function:

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

References CHECK_LT, and inputs_.

Referenced by get_left_deep_join_root().

729  {
730  CHECK_LT(idx, inputs_.size());
731  return inputs_[idx];
732  }
#define CHECK_LT(x, y)
Definition: Logger.h:207
RelAlgInputs inputs_

+ Here is the caller graph for this function:

const void* RelAlgNode::getContextData ( ) const
inline

Definition at line 717 of file RelAlgDagBuilder.h.

References CHECK(), and context_data_.

717  {
719  return context_data_;
720  }
const void * context_data_
CHECK(cgen_state)

+ Here is the call graph for this function:

unsigned RelAlgNode::getId ( ) const
inline

Definition at line 713 of file RelAlgDagBuilder.h.

References id_.

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

713 { 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 724 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(), anonymous_namespace{RelAlgOptimizer.cpp}::get_actual_source_size(), anonymous_namespace{RelAlgExecutor.cpp}::get_data_sink(), anonymous_namespace{RelAlgOptimizer.cpp}::get_field_name(), 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(), 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::unordered_set< int > >::visit(), JoinTargetRebaser::visitInput(), and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitSort().

724  {
725  CHECK_LT(idx, inputs_.size());
726  return inputs_[idx].get();
727  }
#define CHECK_LT(x, y)
Definition: Logger.h:207
RelAlgInputs inputs_

+ Here is the caller graph for this function:

const std::vector<TargetMetaInfo>& RelAlgNode::getOutputMetainfo ( ) const
inline
bool RelAlgNode::hasContextData ( ) const
inline

Definition at line 715 of file RelAlgDagBuilder.h.

References context_data_.

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

Definition at line 738 of file RelAlgDagBuilder.h.

References inputs_.

Referenced by RelAlgExecutor::executeUnion().

738  {
739  for (auto& input_ptr : inputs_) {
740  if (input_ptr.get() == needle) {
741  return true;
742  }
743  }
744  return false;
745  }
RelAlgInputs inputs_

+ Here is the caller graph for this function:

const size_t RelAlgNode::inputCount ( ) const
inline

Definition at line 722 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::createTableFunctionWorkUnit(), RelAlgExecutor::executeProject(), anonymous_namespace{RelAlgExecutor.cpp}::get_data_sink(), 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::unordered_set< int > >::visit(), anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitLeftDeepInnerJoin(), and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitSort().

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

+ Here is the caller graph for this function:

bool RelAlgNode::isNop ( ) const
inline

Definition at line 757 of file RelAlgDagBuilder.h.

References is_nop_.

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

Definition at line 759 of file RelAlgDagBuilder.h.

References is_nop_.

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

759 { 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, RelJoin, and RelProject.

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

748  {
749  for (auto& input_ptr : inputs_) {
750  if (input_ptr == old_input) {
751  input_ptr = input;
752  break;
753  }
754  }
755  }
RelAlgInputs inputs_

+ Here is the caller graph for this function:

void RelAlgNode::resetQueryExecutionState ( )
inline

Definition at line 695 of file RelAlgDagBuilder.h.

References context_data_, and targets_metainfo_.

695  {
696  context_data_ = nullptr;
697  targets_metainfo_ = {};
698  }
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 700 of file RelAlgDagBuilder.h.

References CHECK(), and context_data_.

700  {
702  context_data_ = context_data;
703  }
const void * context_data_
CHECK(cgen_state)

+ Here is the call graph for this function:

void RelAlgNode::setOutputMetainfo ( const std::vector< TargetMetaInfo > &  targets_metainfo) const
inline

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

705  {
706  targets_metainfo_ = targets_metainfo;
707  }
std::vector< TargetMetaInfo > targets_metainfo_

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

Referenced by resetRelAlgFirstId().

const unsigned RelAlgNode::id_
protected

Definition at line 771 of file RelAlgDagBuilder.h.

Referenced by getId().

bool RelAlgNode::is_nop_
private

Definition at line 775 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: