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

#include <Analyzer.h>

+ Inheritance diagram for Analyzer::RangeOper:
+ Collaboration diagram for Analyzer::RangeOper:

Public Member Functions

 RangeOper (const bool l_inclusive, const bool r_inclusive, std::shared_ptr< Analyzer::Expr > l, std::shared_ptr< Analyzer::Expr > r)
 
const Exprget_left_operand () const
 
const Exprget_right_operand () const
 
std::shared_ptr< Analyzer::Exprdeep_copy () const override
 
bool operator== (const Expr &rhs) const override
 
std::string toString () const override
 
void collect_rte_idx (std::set< int > &rte_idx_set) const override
 
void collect_column_var (std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const override
 
- Public Member Functions inherited from Analyzer::Expr
 Expr (SQLTypes t, bool notnull)
 
 Expr (SQLTypes t, int d, bool notnull)
 
 Expr (SQLTypes t, int d, int s, bool notnull)
 
 Expr (const SQLTypeInfo &ti, bool has_agg=false)
 
virtual ~Expr ()
 
std::shared_ptr< Analyzer::Exprget_shared_ptr ()
 
const SQLTypeInfoget_type_info () const
 
void set_type_info (const SQLTypeInfo &ti)
 
bool get_contains_agg () const
 
void set_contains_agg (bool a)
 
virtual std::shared_ptr
< Analyzer::Expr
add_cast (const SQLTypeInfo &new_type_info)
 
virtual void check_group_by (const std::list< std::shared_ptr< Analyzer::Expr >> &groupby) const
 
virtual std::shared_ptr
< Analyzer::Expr
normalize_simple_predicate (int &rte_idx) const
 
virtual void group_predicates (std::list< const Expr * > &scan_predicates, std::list< const Expr * > &join_predicates, std::list< const Expr * > &const_predicates) const
 
virtual size_t get_num_column_vars (const bool include_agg) const
 
virtual std::shared_ptr
< Analyzer::Expr
rewrite_with_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual std::shared_ptr
< Analyzer::Expr
rewrite_with_child_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual std::shared_ptr
< Analyzer::Expr
rewrite_agg_to_var (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual void print () const
 
virtual void add_unique (std::list< const Expr * > &expr_list) const
 
virtual void find_expr (std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const
 
std::shared_ptr< Analyzer::Exprdecompress ()
 
virtual void get_domain (DomainSet &domain_set) const
 

Private Attributes

bool left_inclusive_
 
bool right_inclusive_
 
std::shared_ptr< Analyzer::Exprleft_operand_
 
std::shared_ptr< Analyzer::Exprright_operand_
 

Additional Inherited Members

- Protected Attributes inherited from Analyzer::Expr
SQLTypeInfo type_info
 
bool contains_agg
 

Detailed Description

RangeOper

Definition at line 533 of file Analyzer.h.

Constructor & Destructor Documentation

Analyzer::RangeOper::RangeOper ( const bool  l_inclusive,
const bool  r_inclusive,
std::shared_ptr< Analyzer::Expr l,
std::shared_ptr< Analyzer::Expr r 
)
inline

Definition at line 535 of file Analyzer.h.

References CHECK, left_operand_, and right_operand_.

539  : Expr(SQLTypeInfo(kNULLT), /*not_null=*/false)
540  , left_inclusive_(l_inclusive)
541  , right_inclusive_(r_inclusive)
542  , left_operand_(l)
543  , right_operand_(r) {
546  }
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:74
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:573
#define CHECK(condition)
Definition: Logger.h:289
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:572

Member Function Documentation

void Analyzer::RangeOper::collect_column_var ( std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &  colvar_set,
bool  include_agg 
) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 560 of file Analyzer.h.

References left_operand_, and right_operand_.

563  {
564  left_operand_->collect_column_var(colvar_set, include_agg);
565  right_operand_->collect_column_var(colvar_set, include_agg);
566  }
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:573
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:572
void Analyzer::RangeOper::collect_rte_idx ( std::set< int > &  rte_idx_set) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 555 of file Analyzer.h.

References left_operand_, and right_operand_.

555  {
556  left_operand_->collect_rte_idx(rte_idx_set);
557  right_operand_->collect_rte_idx(rte_idx_set);
558  }
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:573
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:572
std::shared_ptr< Analyzer::Expr > Analyzer::RangeOper::deep_copy ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 115 of file Analyzer.cpp.

References left_inclusive_, left_operand_, right_inclusive_, and right_operand_.

115  {
116  return makeExpr<RangeOper>(left_inclusive_,
118  left_operand_->deep_copy(),
119  right_operand_->deep_copy());
120 }
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:573
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:572
const Expr* Analyzer::RangeOper::get_left_operand ( ) const
inline

Definition at line 548 of file Analyzer.h.

References left_operand_.

Referenced by RangeJoinHashTable::getInstance(), RangeJoinHashTable::isInnerColCompressed(), RangeJoinHashTable::reifyWithLayout(), and ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitRangeJoinOper().

548 { return left_operand_.get(); }
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:572

+ Here is the caller graph for this function:

const Expr* Analyzer::RangeOper::get_right_operand ( ) const
inline

Definition at line 549 of file Analyzer.h.

References right_operand_.

Referenced by RangeJoinHashTable::reifyWithLayout(), and ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitRangeJoinOper().

549 { return right_operand_.get(); }
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:573

+ Here is the caller graph for this function:

bool Analyzer::RangeOper::operator== ( const Expr rhs) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2296 of file Analyzer.cpp.

References left_inclusive_, left_operand_, right_inclusive_, and right_operand_.

2296  {
2297  if (typeid(rhs) != typeid(RangeOper)) {
2298  return false;
2299  }
2300  const RangeOper& rhs_rg = dynamic_cast<const RangeOper&>(rhs);
2301  return left_inclusive_ == rhs_rg.left_inclusive_ &&
2302  right_inclusive_ == rhs_rg.right_inclusive_ &&
2303  *left_operand_ == *rhs_rg.left_operand_ &&
2304  *right_operand_ == *rhs_rg.right_operand_;
2305 }
RangeOper(const bool l_inclusive, const bool r_inclusive, std::shared_ptr< Analyzer::Expr > l, std::shared_ptr< Analyzer::Expr > r)
Definition: Analyzer.h:535
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:573
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:572
std::string Analyzer::RangeOper::toString ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2732 of file Analyzer.cpp.

References left_inclusive_, left_operand_, right_inclusive_, and right_operand_.

Referenced by RangeJoinHashTable::getInstance().

2732  {
2733  const std::string lhs = left_inclusive_ ? "[" : "(";
2734  const std::string rhs = right_inclusive_ ? "]" : ")";
2735  return "(RangeOper " + lhs + " " + left_operand_->toString() + " , " +
2736  right_operand_->toString() + " " + rhs + " )";
2737 }
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:573
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:572

+ Here is the caller graph for this function:

Member Data Documentation

bool Analyzer::RangeOper::left_inclusive_
private

Definition at line 570 of file Analyzer.h.

Referenced by deep_copy(), operator==(), and toString().

std::shared_ptr<Analyzer::Expr> Analyzer::RangeOper::left_operand_
private
bool Analyzer::RangeOper::right_inclusive_
private

Definition at line 571 of file Analyzer.h.

Referenced by deep_copy(), operator==(), and toString().

std::shared_ptr<Analyzer::Expr> Analyzer::RangeOper::right_operand_
private

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