OmniSciDB  c07336695a
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 ()
 
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 238 of file Analyzer.h.

Constructor & Destructor Documentation

◆ ExpressionTuple()

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

Definition at line 240 of file Analyzer.h.

241  : Expr(SQLTypeInfo()), tuple_(tuple){};
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:69
SQLTypeInfoCore< ArrayContextTypeSizer, ExecutorTypePackaging, DateTimeFacilities > SQLTypeInfo
Definition: sqltypes.h:819
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:253

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:253

◆ 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:253
#define CHECK(condition)
Definition: Logger.h:187
+ 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 243 of file Analyzer.h.

References operator==().

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

243 { return tuple_; }
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:253
+ 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 1942 of file Analyzer.cpp.

References expr_list_match(), and getTuple().

1942  {
1943  const auto rhs_tuple = dynamic_cast<const ExpressionTuple*>(&rhs);
1944  if (!rhs_tuple) {
1945  return false;
1946  }
1947  const auto& rhs_tuple_cols = rhs_tuple->getTuple();
1948  return expr_list_match(tuple_, rhs_tuple_cols);
1949 }
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:2980
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:253
ExpressionTuple(const std::vector< std::shared_ptr< Analyzer::Expr >> &tuple)
Definition: Analyzer.h:240
+ Here is the call graph for this function:

◆ toString()

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

Implements Analyzer::Expr.

Definition at line 2246 of file Analyzer.cpp.

2246  {
2247  std::string str{"< "};
2248  for (const auto& column : tuple_) {
2249  str += column->toString();
2250  }
2251  str += "> ";
2252  return str;
2253 }
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:253

Member Data Documentation

◆ tuple_

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

Definition at line 253 of file Analyzer.h.


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