OmniSciDB  085a039ca4
 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 (bool(*f)(const Expr *), 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 531 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 533 of file Analyzer.h.

References CHECK, left_operand_, and right_operand_.

537  : Expr(SQLTypeInfo(kNULLT), /*not_null=*/false)
538  , left_inclusive_(l_inclusive)
539  , right_inclusive_(r_inclusive)
540  , left_operand_(l)
541  , right_operand_(r) {
544  }
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:72
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:571
#define CHECK(condition)
Definition: Logger.h:223
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:570

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

References left_operand_, and right_operand_.

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

Reimplemented from Analyzer::Expr.

Definition at line 553 of file Analyzer.h.

References left_operand_, and right_operand_.

553  {
554  left_operand_->collect_rte_idx(rte_idx_set);
555  right_operand_->collect_rte_idx(rte_idx_set);
556  }
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:571
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:570
std::shared_ptr< Analyzer::Expr > Analyzer::RangeOper::deep_copy ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 117 of file Analyzer.cpp.

References left_inclusive_, left_operand_, right_inclusive_, and right_operand_.

117  {
118  return makeExpr<RangeOper>(left_inclusive_,
120  left_operand_->deep_copy(),
121  right_operand_->deep_copy());
122 }
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:571
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:570
const Expr* Analyzer::RangeOper::get_left_operand ( ) const
inline

Definition at line 546 of file Analyzer.h.

References left_operand_.

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

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

+ Here is the caller graph for this function:

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

Definition at line 547 of file Analyzer.h.

References right_operand_.

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

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

+ Here is the caller graph for this function:

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

Implements Analyzer::Expr.

Definition at line 2249 of file Analyzer.cpp.

References left_inclusive_, left_operand_, right_inclusive_, and right_operand_.

2249  {
2250  if (typeid(rhs) != typeid(RangeOper)) {
2251  return false;
2252  }
2253  const RangeOper& rhs_rg = dynamic_cast<const RangeOper&>(rhs);
2254  return left_inclusive_ == rhs_rg.left_inclusive_ &&
2255  right_inclusive_ == rhs_rg.right_inclusive_ &&
2256  *left_operand_ == *rhs_rg.left_operand_ &&
2257  *right_operand_ == *rhs_rg.right_operand_;
2258 }
RangeOper(const bool l_inclusive, const bool r_inclusive, std::shared_ptr< Analyzer::Expr > l, std::shared_ptr< Analyzer::Expr > r)
Definition: Analyzer.h:533
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:571
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:570
std::string Analyzer::RangeOper::toString ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2669 of file Analyzer.cpp.

References left_inclusive_, left_operand_, right_inclusive_, and right_operand_.

Referenced by RangeJoinHashTable::getInstance().

2669  {
2670  const std::string lhs = left_inclusive_ ? "[" : "(";
2671  const std::string rhs = right_inclusive_ ? "]" : ")";
2672  return "(RangeOper " + lhs + " " + left_operand_->toString() + " , " +
2673  right_operand_->toString() + " " + rhs + " )";
2674 }
std::shared_ptr< Analyzer::Expr > right_operand_
Definition: Analyzer.h:571
std::shared_ptr< Analyzer::Expr > left_operand_
Definition: Analyzer.h:570

+ Here is the caller graph for this function:

Member Data Documentation

bool Analyzer::RangeOper::left_inclusive_
private

Definition at line 568 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 569 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: