OmniSciDB  a5dc49c757
 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 537 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 539 of file Analyzer.h.

References CHECK, left_operand_, and right_operand_.

543  : Expr(SQLTypeInfo(kNULLT), /*not_null=*/false)
544  , left_inclusive_(l_inclusive)
545  , right_inclusive_(r_inclusive)
546  , left_operand_(l)
547  , right_operand_(r) {
550  }
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:70
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:577
#define CHECK(condition)
Definition: Logger.h:291
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:576

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 564 of file Analyzer.h.

References left_operand_, and right_operand_.

567  {
568  left_operand_->collect_column_var(colvar_set, include_agg);
569  right_operand_->collect_column_var(colvar_set, include_agg);
570  }
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:577
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:576
void Analyzer::RangeOper::collect_rte_idx ( std::set< int > &  rte_idx_set) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 559 of file Analyzer.h.

References left_operand_, and right_operand_.

559  {
560  left_operand_->collect_rte_idx(rte_idx_set);
561  right_operand_->collect_rte_idx(rte_idx_set);
562  }
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:577
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:576
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:577
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:576
const Expr* Analyzer::RangeOper::get_left_operand ( ) const
inline

Definition at line 552 of file Analyzer.h.

References left_operand_.

Referenced by RangeJoinHashTable::getInstance(), RangeJoinHashTable::isInnerColCompressed(), RangeJoinHashTable::reifyWithLayout(), and ScalarExprVisitor< std::set< shared::TableKey > >::visitRangeJoinOper().

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

+ Here is the caller graph for this function:

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

Definition at line 553 of file Analyzer.h.

References right_operand_.

Referenced by RangeJoinHashTable::reifyWithLayout(), and ScalarExprVisitor< std::set< shared::TableKey > >::visitRangeJoinOper().

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

+ Here is the caller graph for this function:

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

Implements Analyzer::Expr.

Definition at line 2368 of file Analyzer.cpp.

References left_inclusive_, left_operand_, right_inclusive_, and right_operand_.

2368  {
2369  if (typeid(rhs) != typeid(RangeOper)) {
2370  return false;
2371  }
2372  const RangeOper& rhs_rg = dynamic_cast<const RangeOper&>(rhs);
2373  return left_inclusive_ == rhs_rg.left_inclusive_ &&
2374  right_inclusive_ == rhs_rg.right_inclusive_ &&
2375  *left_operand_ == *rhs_rg.left_operand_ &&
2376  *right_operand_ == *rhs_rg.right_operand_;
2377 }
RangeOper(const bool l_inclusive, const bool r_inclusive, std::shared_ptr< Analyzer::Expr > l, std::shared_ptr< Analyzer::Expr > r)
Definition: Analyzer.h:539
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:577
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:576
std::string Analyzer::RangeOper::toString ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2850 of file Analyzer.cpp.

References left_inclusive_, left_operand_, right_inclusive_, and right_operand_.

Referenced by RangeJoinHashTable::getInstance().

2850  {
2851  const std::string lhs = left_inclusive_ ? "[" : "(";
2852  const std::string rhs = right_inclusive_ ? "]" : ")";
2853  return "(RangeOper " + lhs + " " + left_operand_->toString() + " , " +
2854  right_operand_->toString() + " " + rhs + " )";
2855 }
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:577
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:576

+ Here is the caller graph for this function:

Member Data Documentation

bool Analyzer::RangeOper::left_inclusive_
private

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