OmniSciDB  340b00dbf6
 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 694 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 696 of file RelAlgDagBuilder.h.

696  {})
697  : inputs_(std::move(inputs))
698  , id_(crt_id_++)
699  , context_data_(nullptr)
700  , 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 702 of file RelAlgDagBuilder.h.

702 {}

Member Function Documentation

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

Definition at line 743 of file RelAlgDagBuilder.h.

References inputs_.

Referenced by RelLeftDeepInnerJoin::RelLeftDeepInnerJoin().

743  {
744  inputs_.push_back(input);
745  }
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 782 of file RelAlgDagBuilder.h.

References context_data_.

782 { 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 738 of file RelAlgDagBuilder.h.

References CHECK_LT, and inputs_.

Referenced by get_left_deep_join_root().

738  {
739  CHECK_LT(idx, inputs_.size());
740  return inputs_[idx];
741  }
#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 726 of file RelAlgDagBuilder.h.

References CHECK, and context_data_.

726  {
728  return context_data_;
729  }
const void * context_data_
#define CHECK(condition)
Definition: Logger.h:197
unsigned RelAlgNode::getId ( ) const
inline

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

722 { 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 733 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().

733  {
734  CHECK_LT(idx, inputs_.size());
735  return inputs_[idx].get();
736  }
#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 724 of file RelAlgDagBuilder.h.

References context_data_.

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

Definition at line 747 of file RelAlgDagBuilder.h.

References inputs_.

Referenced by RelAlgExecutor::executeUnion().

747  {
748  for (auto& input_ptr : inputs_) {
749  if (input_ptr.get() == needle) {
750  return true;
751  }
752  }
753  return false;
754  }
RelAlgInputs inputs_

+ Here is the caller graph for this function:

const size_t RelAlgNode::inputCount ( ) const
inline

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

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

+ Here is the caller graph for this function:

bool RelAlgNode::isNop ( ) const
inline

Definition at line 766 of file RelAlgDagBuilder.h.

References is_nop_.

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

Definition at line 768 of file RelAlgDagBuilder.h.

References is_nop_.

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

768 { 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 756 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().

757  {
758  for (auto& input_ptr : inputs_) {
759  if (input_ptr == old_input) {
760  input_ptr = input;
761  break;
762  }
763  }
764  }
RelAlgInputs inputs_

+ Here is the caller graph for this function:

void RelAlgNode::resetQueryExecutionState ( )
inline

Definition at line 704 of file RelAlgDagBuilder.h.

References context_data_, and targets_metainfo_.

704  {
705  context_data_ = nullptr;
706  targets_metainfo_ = {};
707  }
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 709 of file RelAlgDagBuilder.h.

References CHECK, and context_data_.

709  {
711  context_data_ = context_data;
712  }
const void * context_data_
#define CHECK(condition)
Definition: Logger.h:197
void RelAlgNode::setOutputMetainfo ( const std::vector< TargetMetaInfo > &  targets_metainfo) const
inline

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

714  {
715  targets_metainfo_ = targets_metainfo;
716  }
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 792 of file RelAlgDagBuilder.h.

Referenced by resetRelAlgFirstId().

const unsigned RelAlgNode::id_
protected

Definition at line 786 of file RelAlgDagBuilder.h.

Referenced by getId().

bool RelAlgNode::is_nop_
private

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