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

#include <RelAlgDagBuilder.h>

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

Public Member Functions

 RelFilter (std::unique_ptr< const RexScalar > &filter, std::shared_ptr< const RelAlgNode > input)
 
 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 () const override
 
std::shared_ptr< RelAlgNodedeepCopy () const override
 
- Public Member Functions inherited from RelAlgNode
 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
 
bool isNop () const
 
void markAsNop ()
 
void clearContextData () const
 

Private Attributes

std::unique_ptr< const RexScalarfilter_
 

Additional Inherited Members

- Static Public Member Functions inherited from RelAlgNode
static void resetRelAlgFirstId () noexcept
 
- Protected Attributes inherited from RelAlgNode
RelAlgInputs inputs_
 
const unsigned id_
 

Detailed Description

Definition at line 1197 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 1199 of file RelAlgDagBuilder.h.

References CHECK, filter_, and RelAlgNode::inputs_.

1201  : filter_(std::move(filter)) {
1202  CHECK(filter_);
1203  inputs_.push_back(input);
1204  }
std::unique_ptr< const RexScalar > filter_
#define CHECK(condition)
Definition: Logger.h:197
RelAlgInputs inputs_
RelFilter::RelFilter ( RelFilter const &  rhs)

Definition at line 359 of file RelAlgDagBuilder.cpp.

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

359  : RelAlgNode(rhs) {
360  RexDeepCopyVisitor copier;
361  filter_ = copier.visit(rhs.filter_.get());
362 }
RelAlgNode(RelAlgInputs inputs={})
virtual T visit(const RexScalar *rex_scalar) const
Definition: RexVisitor.h:27
std::unique_ptr< const RexScalar > filter_

+ Here is the call graph for this function:

Member Function Documentation

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

Implements RelAlgNode.

Definition at line 1230 of file RelAlgDagBuilder.h.

1230  {
1231  return std::make_shared<RelFilter>(*this);
1232  }
const RexScalar* RelFilter::getAndReleaseCondition ( )
inline

Definition at line 1210 of file RelAlgDagBuilder.h.

References filter_.

1210 { return filter_.release(); }
std::unique_ptr< const RexScalar > filter_
const RexScalar* RelFilter::getCondition ( ) const
inline

Definition at line 1208 of file RelAlgDagBuilder.h.

References filter_.

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

1208 { return filter_.get(); }
std::unique_ptr< const RexScalar > filter_

+ 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 318 of file RelAlgDagBuilder.cpp.

References filter_, and RelAlgNode::replaceInput().

319  {
320  RelAlgNode::replaceInput(old_input, input);
321  RexRebindInputsVisitor rebind_inputs(old_input.get(), input.get());
322  rebind_inputs.visit(filter_.get());
323 }
std::unique_ptr< const RexScalar > filter_
virtual void replaceInput(std::shared_ptr< const RelAlgNode > old_input, std::shared_ptr< const RelAlgNode > input)

+ Here is the call graph for this function:

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

Definition at line 1212 of file RelAlgDagBuilder.h.

References CHECK, and filter_.

Referenced by hoist_filter_cond_to_cross_join().

1212  {
1213  CHECK(condition);
1214  filter_ = std::move(condition);
1215  }
std::unique_ptr< const RexScalar > filter_
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the caller graph for this function:

size_t RelFilter::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1217 of file RelAlgDagBuilder.h.

References RelAlgNode::inputs_.

1217 { return inputs_[0]->size(); }
RelAlgInputs inputs_
std::string RelFilter::toString ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1222 of file RelAlgDagBuilder.h.

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

1222  {
1223  return cat(::typeName(this),
1224  "(",
1225  (filter_ ? filter_->toString() : "null"),
1226  ", ",
1227  ::toString(inputs_) + ")");
1228  }
std::string cat(Ts &&...args)
std::unique_ptr< const RexScalar > filter_
std::string toString() const override
RelAlgInputs inputs_

+ Here is the call graph for this function:

Member Data Documentation

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

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