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

#include <Analyzer.h>

+ Inheritance diagram for Analyzer::ExpressionTuple:
+ Collaboration diagram for Analyzer::ExpressionTuple:

Public Member Functions

 ExpressionTuple (const std::vector< std::shared_ptr< Analyzer::Expr >> &tuple)
 
const std::vector
< std::shared_ptr
< Analyzer::Expr > > & 
getTuple () const
 
void collect_rte_idx (std::set< int > &rte_idx_set) const override
 
std::shared_ptr< Analyzer::Exprdeep_copy () const override
 
bool operator== (const Expr &rhs) const override
 
std::string toString () 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 void collect_column_var (std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) 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

const std::vector
< std::shared_ptr
< Analyzer::Expr > > 
tuple_
 

Additional Inherited Members

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

Detailed Description

Definition at line 248 of file Analyzer.h.

Constructor & Destructor Documentation

Analyzer::ExpressionTuple::ExpressionTuple ( const std::vector< std::shared_ptr< Analyzer::Expr >> &  tuple)
inline

Definition at line 250 of file Analyzer.h.

251  : Expr(SQLTypeInfo()), tuple_(tuple){};
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:70
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:263

Member Function Documentation

void Analyzer::ExpressionTuple::collect_rte_idx ( std::set< int > &  rte_idx_set) const
overridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 70 of file Analyzer.cpp.

References tuple_.

70  {
71  for (const auto& column : tuple_) {
72  column->collect_rte_idx(rte_idx_set);
73  }
74 }
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:263
std::shared_ptr< Analyzer::Expr > Analyzer::ExpressionTuple::deep_copy ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 76 of file Analyzer.cpp.

References CHECK, and tuple_.

Referenced by DeepCopyVisitor::visitColumnVarTuple().

76  {
77  std::vector<std::shared_ptr<Expr>> tuple_deep_copy;
78  for (const auto& column : tuple_) {
79  const auto column_deep_copy =
80  std::dynamic_pointer_cast<Analyzer::ColumnVar>(column->deep_copy());
81  CHECK(column_deep_copy);
82  tuple_deep_copy.push_back(column_deep_copy);
83  }
84  return makeExpr<ExpressionTuple>(tuple_deep_copy);
85 }
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:263
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function:

const std::vector<std::shared_ptr<Analyzer::Expr> >& Analyzer::ExpressionTuple::getTuple ( ) const
inline

Definition at line 253 of file Analyzer.h.

References tuple_.

Referenced by operator==(), MaxRangeTableIndexVisitor::visitColumnVarTuple(), AllRangeTableIndexVisitor::visitColumnVarTuple(), ColumnVarsVisitor::visitColumnVarTuple(), and AllColumnVarsVisitor::visitColumnVarTuple().

253 { return tuple_; }
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:263

+ Here is the caller graph for this function:

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

Implements Analyzer::Expr.

Definition at line 2282 of file Analyzer.cpp.

References expr_list_match(), getTuple(), and tuple_.

2282  {
2283  const auto rhs_tuple = dynamic_cast<const ExpressionTuple*>(&rhs);
2284  if (!rhs_tuple) {
2285  return false;
2286  }
2287  const auto& rhs_tuple_cols = rhs_tuple->getTuple();
2288  return expr_list_match(tuple_, rhs_tuple_cols);
2289 }
bool expr_list_match(const std::vector< std::shared_ptr< Analyzer::Expr >> &lhs, const std::vector< std::shared_ptr< Analyzer::Expr >> &rhs)
Definition: Analyzer.cpp:4598
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:263
ExpressionTuple(const std::vector< std::shared_ptr< Analyzer::Expr >> &tuple)
Definition: Analyzer.h:250

+ Here is the call graph for this function:

std::string Analyzer::ExpressionTuple::toString ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2724 of file Analyzer.cpp.

References tuple_.

2724  {
2725  std::string str{"< "};
2726  for (const auto& column : tuple_) {
2727  str += column->toString();
2728  }
2729  str += "> ";
2730  return str;
2731 }
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:263

Member Data Documentation

const std::vector<std::shared_ptr<Analyzer::Expr> > Analyzer::ExpressionTuple::tuple_
private

Definition at line 263 of file Analyzer.h.

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


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