OmniSciDB  94e8789169
 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 695 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 697 of file RelAlgDagBuilder.h.

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

703 {}

Member Function Documentation

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

Definition at line 744 of file RelAlgDagBuilder.h.

References inputs_.

Referenced by RelLeftDeepInnerJoin::RelLeftDeepInnerJoin().

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

References context_data_.

783 { 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 739 of file RelAlgDagBuilder.h.

References CHECK_LT, and inputs_.

Referenced by get_left_deep_join_root().

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

References CHECK, and context_data_.

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

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

723 { 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 734 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().

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

References context_data_.

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

Definition at line 748 of file RelAlgDagBuilder.h.

References inputs_.

Referenced by RelAlgExecutor::executeUnion().

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

+ Here is the caller graph for this function:

const size_t RelAlgNode::inputCount ( ) const
inline

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

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

+ Here is the caller graph for this function:

bool RelAlgNode::isNop ( ) const
inline

Definition at line 767 of file RelAlgDagBuilder.h.

References is_nop_.

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

Definition at line 769 of file RelAlgDagBuilder.h.

References is_nop_.

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

769 { 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 757 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().

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

+ Here is the caller graph for this function:

void RelAlgNode::resetQueryExecutionState ( )
inline

Definition at line 705 of file RelAlgDagBuilder.h.

References context_data_, and targets_metainfo_.

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

References CHECK, and context_data_.

710  {
712  context_data_ = context_data;
713  }
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 715 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().

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

Referenced by resetRelAlgFirstId().

const unsigned RelAlgNode::id_
protected

Definition at line 787 of file RelAlgDagBuilder.h.

Referenced by getId().

bool RelAlgNode::is_nop_
private

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