OmniSciDB  c07336695a
RelFilter Class Reference

#include <RelAlgAbstractInterpreter.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)
 
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 ()
 
virtual ~RelAlgNode ()
 
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 ()
 

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
std::vector< std::shared_ptr< const RelAlgNode > > inputs_
 
const unsigned id_
 

Detailed Description

Definition at line 974 of file RelAlgAbstractInterpreter.h.

Constructor & Destructor Documentation

◆ RelFilter()

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

Definition at line 976 of file RelAlgAbstractInterpreter.h.

References CHECK.

978  : filter_(std::move(filter)) {
979  CHECK(filter_);
980  inputs_.push_back(input);
981  }
std::vector< std::shared_ptr< const RelAlgNode > > inputs_
std::unique_ptr< const RexScalar > filter_
#define CHECK(condition)
Definition: Logger.h:187

Member Function Documentation

◆ deepCopy()

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

Implements RelAlgNode.

Definition at line 290 of file RelAlgAbstractInterpreter.cpp.

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

290  {
291  RexDeepCopyVisitor copier;
292  auto filter_copy = copier.visit(filter_.get());
293  return std::make_shared<RelFilter>(filter_copy, inputs_[0]);
294 }
std::vector< std::shared_ptr< const RelAlgNode > > inputs_
std::unique_ptr< const RexScalar > filter_
virtual T visit(const RexScalar *rex_scalar) const
Definition: RexVisitor.h:27
+ Here is the call graph for this function:

◆ getAndReleaseCondition()

const RexScalar* RelFilter::getAndReleaseCondition ( )
inline

Definition at line 985 of file RelAlgAbstractInterpreter.h.

985 { return filter_.release(); }
std::unique_ptr< const RexScalar > filter_

◆ getCondition()

const RexScalar* RelFilter::getCondition ( ) const
inline

Definition at line 983 of file RelAlgAbstractInterpreter.h.

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

983 { return filter_.get(); }
std::unique_ptr< const RexScalar > filter_
+ Here is the caller graph for this function:

◆ replaceInput()

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

Reimplemented from RelAlgNode.

Definition at line 262 of file RelAlgAbstractInterpreter.cpp.

References RelAlgNode::replaceInput().

263  {
264  RelAlgNode::replaceInput(old_input, input);
265  RexRebindInputsVisitor rebind_inputs(old_input.get(), input.get());
266  rebind_inputs.visit(filter_.get());
267 }
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:

◆ setCondition()

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

Definition at line 987 of file RelAlgAbstractInterpreter.h.

References CHECK.

987  {
988  CHECK(condition);
989  filter_ = std::move(condition);
990  }
std::unique_ptr< const RexScalar > filter_
#define CHECK(condition)
Definition: Logger.h:187

◆ size()

size_t RelFilter::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 992 of file RelAlgAbstractInterpreter.h.

992 { return inputs_[0]->size(); }
std::vector< std::shared_ptr< const RelAlgNode > > inputs_

◆ toString()

std::string RelFilter::toString ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 997 of file RelAlgAbstractInterpreter.h.

References run-benchmark-import::result, and to_string().

997  {
998  std::string result =
999  "(RelFilter<" + std::to_string(reinterpret_cast<uint64_t>(this)) + ">(";
1000  result += filter_ ? filter_->toString() : "null";
1001  return result + ")";
1002  }
std::string to_string(char const *&&v)
std::unique_ptr< const RexScalar > filter_
+ Here is the call graph for this function:

Member Data Documentation

◆ filter_

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

Definition at line 1007 of file RelAlgAbstractInterpreter.h.


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