OmniSciDB  fe05a0c208
 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
 
void clearContextData () const
 

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

Constructor & Destructor Documentation

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

Definition at line 619 of file RelAlgDagBuilder.h.

619  {})
620  : inputs_(std::move(inputs))
621  , id_(crt_id_++)
622  , context_data_(nullptr)
623  , 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 625 of file RelAlgDagBuilder.h.

625 {}

Member Function Documentation

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

Definition at line 666 of file RelAlgDagBuilder.h.

References inputs_.

Referenced by RelLeftDeepInnerJoin::RelLeftDeepInnerJoin().

666  {
667  inputs_.push_back(input);
668  }
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 705 of file RelAlgDagBuilder.h.

References context_data_.

705 { 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 661 of file RelAlgDagBuilder.h.

References CHECK_LT, and inputs_.

Referenced by get_left_deep_join_root().

661  {
662  CHECK_LT(idx, inputs_.size());
663  return inputs_[idx];
664  }
#define CHECK_LT(x, y)
Definition: Logger.h:213
RelAlgInputs inputs_

+ Here is the caller graph for this function:

const void* RelAlgNode::getContextData ( ) const
inline

Definition at line 649 of file RelAlgDagBuilder.h.

References CHECK, and context_data_.

649  {
651  return context_data_;
652  }
const void * context_data_
#define CHECK(condition)
Definition: Logger.h:203
unsigned RelAlgNode::getId ( ) const
inline

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

645 { 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 656 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(), RelRexDagVisitor::visit(), JoinTargetRebaser::visitInput(), and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitSort().

656  {
657  CHECK_LT(idx, inputs_.size());
658  return inputs_[idx].get();
659  }
#define CHECK_LT(x, y)
Definition: Logger.h:213
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 647 of file RelAlgDagBuilder.h.

References context_data_.

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

Definition at line 670 of file RelAlgDagBuilder.h.

References inputs_.

Referenced by RelAlgExecutor::executeUnion().

670  {
671  for (auto& input_ptr : inputs_) {
672  if (input_ptr.get() == needle) {
673  return true;
674  }
675  }
676  return false;
677  }
RelAlgInputs inputs_

+ Here is the caller graph for this function:

const size_t RelAlgNode::inputCount ( ) const
inline

Definition at line 654 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(), 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(), RelRexDagVisitor::visit(), anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitLeftDeepInnerJoin(), and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitSort().

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

+ Here is the caller graph for this function:

bool RelAlgNode::isNop ( ) const
inline

Definition at line 689 of file RelAlgDagBuilder.h.

References is_nop_.

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

Definition at line 691 of file RelAlgDagBuilder.h.

References is_nop_.

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

691 { 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 679 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().

680  {
681  for (auto& input_ptr : inputs_) {
682  if (input_ptr == old_input) {
683  input_ptr = input;
684  break;
685  }
686  }
687  }
RelAlgInputs inputs_

+ Here is the caller graph for this function:

void RelAlgNode::resetQueryExecutionState ( )
inline

Definition at line 627 of file RelAlgDagBuilder.h.

References context_data_, and targets_metainfo_.

627  {
628  context_data_ = nullptr;
629  targets_metainfo_ = {};
630  }
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 632 of file RelAlgDagBuilder.h.

References CHECK, and context_data_.

632  {
634  context_data_ = context_data;
635  }
const void * context_data_
#define CHECK(condition)
Definition: Logger.h:203
void RelAlgNode::setOutputMetainfo ( const std::vector< TargetMetaInfo > &  targets_metainfo) const
inline

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

637  {
638  targets_metainfo_ = targets_metainfo;
639  }
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 715 of file RelAlgDagBuilder.h.

Referenced by resetRelAlgFirstId().

const unsigned RelAlgNode::id_
protected

Definition at line 709 of file RelAlgDagBuilder.h.

Referenced by getId().

bool RelAlgNode::is_nop_
private

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