OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RelFilter Class Reference

#include <RelAlgDag.h>

+ Inheritance diagram for RelFilter:
+ Collaboration diagram for RelFilter:

Public Member Functions

 RelFilter ()=default
 
 RelFilter (std::unique_ptr< const RexScalar > &filter, std::shared_ptr< const RelAlgNode > input)
 
 RelFilter (std::unique_ptr< const RexScalar > &filter)
 
 RelFilter (RelFilter const &)
 
const RexScalargetCondition () const
 
const RexScalargetAndReleaseCondition ()
 
void setCondition (std::unique_ptr< const RexScalar > &condition)
 
size_t size () const override
 
void replaceInput (std::shared_ptr< const RelAlgNode > old_input, std::shared_ptr< const RelAlgNode > input) override
 
std::string toString (RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
 
size_t toHash () const override
 
std::shared_ptr< RelAlgNodedeepCopy () const override
 
- Public Member Functions inherited from RelAlgNode
 RelAlgNode (RelAlgInputs inputs={})
 
virtual ~RelAlgNode ()
 
void resetQueryExecutionState ()
 
void setContextData (const RaExecutionDesc *context_data) const
 
void setOutputMetainfo (std::vector< TargetMetaInfo > targets_metainfo) const
 
void setQueryPlanDag (const std::string &extracted_query_plan_dag) const
 
std::string getQueryPlanDag () const
 
size_t getQueryPlanDagHash () const
 
const std::vector
< TargetMetaInfo > & 
getOutputMetainfo () const
 
unsigned getId () const
 
void setIdInPlanTree (size_t id) const
 
std::optional< size_t > getIdInPlanTree () const
 
bool hasContextData () const
 
const RaExecutionDescgetContextData () 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
 
void setRelNodeDagId (const size_t id) const
 
size_t getRelNodeDagId () const
 
bool isNop () const
 
void markAsNop ()
 
void clearContextData () const
 

Private Attributes

std::unique_ptr< const RexScalarfilter_
 

Friends

struct RelAlgDagSerializer
 

Additional Inherited Members

- Static Public Member Functions inherited from RelAlgNode
static void resetRelAlgFirstId () noexcept
 
- Protected Attributes inherited from RelAlgNode
RelAlgInputs inputs_
 
unsigned id_
 
std::optional< size_t > id_in_plan_tree_
 
std::optional< size_t > hash_
 

Detailed Description

Definition at line 1659 of file RelAlgDag.h.

Constructor & Destructor Documentation

RelFilter::RelFilter ( )
default

Referenced by toHash().

+ Here is the caller graph for this function:

RelFilter::RelFilter ( std::unique_ptr< const RexScalar > &  filter,
std::shared_ptr< const RelAlgNode input 
)
inline

Definition at line 1664 of file RelAlgDag.h.

References CHECK, filter_, and RelAlgNode::inputs_.

1666  : filter_(std::move(filter)) {
1667  CHECK(filter_);
1668  inputs_.push_back(input);
1669  }
std::unique_ptr< const RexScalar > filter_
Definition: RelAlgDag.h:1727
#define CHECK(condition)
Definition: Logger.h:289
RelAlgInputs inputs_
Definition: RelAlgDag.h:952
RelFilter::RelFilter ( std::unique_ptr< const RexScalar > &  filter)
inline

Definition at line 1672 of file RelAlgDag.h.

References CHECK, and filter_.

1672  : filter_(std::move(filter)) {
1673  CHECK(filter_);
1674  }
std::unique_ptr< const RexScalar > filter_
Definition: RelAlgDag.h:1727
#define CHECK(condition)
Definition: Logger.h:289
RelFilter::RelFilter ( RelFilter const &  rhs)

Definition at line 578 of file RelAlgDag.cpp.

References filter_, and RexVisitorBase< T >::visit().

578  : RelAlgNode(rhs) {
579  RexDeepCopyVisitor copier;
580  filter_ = copier.visit(rhs.filter_.get());
581 }
RelAlgNode(RelAlgInputs inputs={})
Definition: RelAlgDag.h:840
virtual T visit(const RexScalar *rex_scalar) const
Definition: RexVisitor.h:27
std::unique_ptr< const RexScalar > filter_
Definition: RelAlgDag.h:1727

+ Here is the call graph for this function:

Member Function Documentation

std::shared_ptr<RelAlgNode> RelFilter::deepCopy ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1722 of file RelAlgDag.h.

1722  {
1723  return std::make_shared<RelFilter>(*this);
1724  }
const RexScalar* RelFilter::getAndReleaseCondition ( )
inline

Definition at line 1680 of file RelAlgDag.h.

References filter_.

1680 { return filter_.release(); }
std::unique_ptr< const RexScalar > filter_
Definition: RelAlgDag.h:1727
const RexScalar* RelFilter::getCondition ( ) const
inline

Definition at line 1678 of file RelAlgDag.h.

References filter_.

Referenced by RelAlgExecutor::createFilterWorkUnit(), hoist_filter_cond_to_cross_join(), RelRexDagVisitor::visit(), and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitFilter().

1678 { return filter_.get(); }
std::unique_ptr< const RexScalar > filter_
Definition: RelAlgDag.h:1727

+ Here is the caller graph for this function:

void RelFilter::replaceInput ( std::shared_ptr< const RelAlgNode old_input,
std::shared_ptr< const RelAlgNode input 
)
overridevirtual

Reimplemented from RelAlgNode.

Definition at line 536 of file RelAlgDag.cpp.

References filter_, and RelAlgNode::replaceInput().

537  {
538  RelAlgNode::replaceInput(old_input, input);
539  RexRebindInputsVisitor rebind_inputs(old_input.get(), input.get());
540  rebind_inputs.visit(filter_.get());
541 }
std::unique_ptr< const RexScalar > filter_
Definition: RelAlgDag.h:1727
virtual void replaceInput(std::shared_ptr< const RelAlgNode > old_input, std::shared_ptr< const RelAlgNode > input)
Definition: RelAlgDag.h:915

+ Here is the call graph for this function:

void RelFilter::setCondition ( std::unique_ptr< const RexScalar > &  condition)
inline

Definition at line 1682 of file RelAlgDag.h.

References CHECK, and filter_.

Referenced by hoist_filter_cond_to_cross_join().

1682  {
1683  CHECK(condition);
1684  filter_ = std::move(condition);
1685  }
std::unique_ptr< const RexScalar > filter_
Definition: RelAlgDag.h:1727
#define CHECK(condition)
Definition: Logger.h:289

+ Here is the caller graph for this function:

size_t RelFilter::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1687 of file RelAlgDag.h.

References RelAlgNode::inputs_.

1687 { return inputs_[0]->size(); }
RelAlgInputs inputs_
Definition: RelAlgDag.h:952
size_t RelFilter::toHash ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1711 of file RelAlgDag.h.

References filter_, RelAlgNode::hash_, HASH_N, RelAlgNode::inputs_, and RelFilter().

1711  {
1712  if (!hash_) {
1713  hash_ = typeid(RelFilter).hash_code();
1714  boost::hash_combine(*hash_, filter_ ? filter_->toHash() : HASH_N);
1715  for (auto& node : inputs_) {
1716  boost::hash_combine(*hash_, node->toHash());
1717  }
1718  }
1719  return *hash_;
1720  }
static auto const HASH_N
Definition: RelAlgDag.h:44
std::unique_ptr< const RexScalar > filter_
Definition: RelAlgDag.h:1727
std::optional< size_t > hash_
Definition: RelAlgDag.h:955
RelFilter()=default
RelAlgInputs inputs_
Definition: RelAlgDag.h:952

+ Here is the call graph for this function:

std::string RelFilter::toString ( RelRexToStringConfig  config = RelRexToStringConfig::defaults()) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1692 of file RelAlgDag.h.

References cat(), filter_, RelAlgNode::inputs_, to_string(), and typeName().

1693  {
1694  auto ret =
1695  cat(::typeName(this), "(", (filter_ ? filter_->toString(config) : "null"), ", ");
1696  if (!config.skip_input_nodes) {
1697  ret += ::toString(inputs_);
1698  } else {
1699  ret += ", input node id={";
1700  for (auto& input : inputs_) {
1701  auto node_id_in_plan = input->getIdInPlanTree();
1702  auto node_id_str = node_id_in_plan ? std::to_string(*node_id_in_plan)
1703  : std::to_string(input->getId());
1704  ret += node_id_str + " ";
1705  }
1706  ret += "}";
1707  }
1708  return cat(ret, ")");
1709  }
std::string cat(Ts &&...args)
std::string to_string(char const *&&v)
unsigned getId() const
Definition: RelAlgDag.h:880
std::unique_ptr< const RexScalar > filter_
Definition: RelAlgDag.h:1727
std::string typeName(const T *v)
Definition: toString.h:103
std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
Definition: RelAlgDag.h:1692
RelAlgInputs inputs_
Definition: RelAlgDag.h:952

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend struct RelAlgDagSerializer
friend

Definition at line 1729 of file RelAlgDag.h.

Member Data Documentation

std::unique_ptr<const RexScalar> RelFilter::filter_
private

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