OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 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

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

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
SQLTypeInfoCore< ArrayContextTypeSizer, ExecutorTypePackaging, DateTimeFacilities > SQLTypeInfo
Definition: sqltypes.h:852
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:254

Member Function Documentation

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.

References tuple_.

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
std::shared_ptr< Analyzer::Expr > Analyzer::ExpressionTuple::deep_copy ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 69 of file Analyzer.cpp.

References CHECK(), and tuple_.

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 }
CHECK(cgen_state)
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:

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

Definition at line 244 of file Analyzer.h.

References tuple_.

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

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

+ Here is the caller graph for this function:

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

Implements Analyzer::Expr.

Definition at line 1964 of file Analyzer.cpp.

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

1964  {
1965  const auto rhs_tuple = dynamic_cast<const ExpressionTuple*>(&rhs);
1966  if (!rhs_tuple) {
1967  return false;
1968  }
1969  const auto& rhs_tuple_cols = rhs_tuple->getTuple();
1970  return expr_list_match(tuple_, rhs_tuple_cols);
1971 }
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:3043
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:

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

Implements Analyzer::Expr.

Definition at line 2287 of file Analyzer.cpp.

References tuple_.

2287  {
2288  std::string str{"< "};
2289  for (const auto& column : tuple_) {
2290  str += column->toString();
2291  }
2292  str += "> ";
2293  return str;
2294 }
const std::vector< std::shared_ptr< Analyzer::Expr > > tuple_
Definition: Analyzer.h:254

Member Data Documentation

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

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