OmniSciDB  dfae7c3b14
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::Expradd_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::Exprnormalize_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 std::shared_ptr< Analyzer::Exprrewrite_with_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual std::shared_ptr< Analyzer::Exprrewrite_with_child_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual std::shared_ptr< Analyzer::Exprrewrite_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

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

Constructor & Destructor Documentation

◆ ExpressionTuple()

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

Definition at line 241 of file Analyzer.h.

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

Member Function Documentation

◆ collect_rte_idx()

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

Reimplemented from Analyzer::Expr.

Definition at line 63 of file Analyzer.cpp.

63  {
64  for (const auto& column : tuple_) {
65  column->collect_rte_idx(rte_idx_set);
66  }
67 }
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:254

◆ deep_copy()

std::shared_ptr< Analyzer::Expr > Analyzer::ExpressionTuple::deep_copy ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 69 of file Analyzer.cpp.

References CHECK.

Referenced by DeepCopyVisitor::visitColumnVarTuple().

69  {
70  std::vector<std::shared_ptr<Expr>> tuple_deep_copy;
71  for (const auto& column : tuple_) {
72  const auto column_deep_copy =
73  std::dynamic_pointer_cast<Analyzer::ColumnVar>(column->deep_copy());
74  CHECK(column_deep_copy);
75  tuple_deep_copy.push_back(column_deep_copy);
76  }
77  return makeExpr<ExpressionTuple>(tuple_deep_copy);
78 }
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:254
#define CHECK(condition)
Definition: Logger.h:197
+ Here is the caller graph for this function:

◆ getTuple()

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

Definition at line 244 of file Analyzer.h.

References operator==(), and toString().

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

244 { return tuple_; }
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:254
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator==()

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

Implements Analyzer::Expr.

Definition at line 2053 of file Analyzer.cpp.

References expr_list_match(), and getTuple().

2053  {
2054  const auto rhs_tuple = dynamic_cast<const ExpressionTuple*>(&rhs);
2055  if (!rhs_tuple) {
2056  return false;
2057  }
2058  const auto& rhs_tuple_cols = rhs_tuple->getTuple();
2059  return expr_list_match(tuple_, rhs_tuple_cols);
2060 }
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:3228
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:254
ExpressionTuple(const std::vector< std::shared_ptr< Analyzer::Expr >> &tuple)
Definition: Analyzer.h:241
+ Here is the call graph for this function:

◆ toString()

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

Implements Analyzer::Expr.

Definition at line 2409 of file Analyzer.cpp.

2409  {
2410  std::string str{"< "};
2411  for (const auto& column : tuple_) {
2412  str += column->toString();
2413  }
2414  str += "> ";
2415  return str;
2416 }
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:254

Member Data Documentation

◆ tuple_

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

Definition at line 254 of file Analyzer.h.


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