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

#include <Analyzer.h>

+ Collaboration diagram for Analyzer::Query:

Public Member Functions

 Query ()
 
virtual ~Query ()
 
bool get_is_distinct () const
 
int get_num_aggs () const
 
const std::vector
< std::shared_ptr< TargetEntry > > & 
get_targetlist () const
 
std::vector< std::shared_ptr
< TargetEntry > > & 
get_targetlist_nonconst ()
 
const std::vector< std::vector
< std::shared_ptr< TargetEntry > > > & 
get_values_lists () const
 
std::vector< std::vector
< std::shared_ptr< TargetEntry > > > & 
get_values_lists ()
 
const std::vector
< RangeTableEntry * > & 
get_rangetable () const
 
const Exprget_where_predicate () const
 
const std::list
< std::shared_ptr
< Analyzer::Expr > > & 
get_group_by () const
 
const Exprget_having_predicate () const
 
const std::list< OrderEntry > * get_order_by () const
 
const Queryget_next_query () const
 
SQLStmtType get_stmt_type () const
 
bool get_is_unionall () const
 
int get_result_table_id () const
 
const std::list< int > & get_result_col_list () const
 
void set_result_col_list (const std::list< int > &col_list)
 
void set_result_table_id (int id)
 
void set_is_distinct (bool d)
 
void set_where_predicate (std::shared_ptr< Analyzer::Expr > p)
 
void set_group_by (std::list< std::shared_ptr< Analyzer::Expr >> &g)
 
void set_having_predicate (std::shared_ptr< Analyzer::Expr > p)
 
void set_order_by (std::list< OrderEntry > *o)
 
void set_next_query (Query *q)
 
void set_is_unionall (bool u)
 
void set_stmt_type (SQLStmtType t)
 
void set_num_aggs (int a)
 
int get_rte_idx (const std::string &range_var_name) const
 
RangeTableEntryget_rte (int rte_idx) const
 
void add_rte (RangeTableEntry *rte)
 
void add_tle (std::shared_ptr< TargetEntry > tle)
 
int64_t get_limit () const
 
void set_limit (int64_t l)
 
int64_t get_offset () const
 
void set_offset (int64_t o)
 

Private Attributes

bool is_distinct
 
std::vector< std::shared_ptr
< TargetEntry > > 
targetlist
 
std::vector< RangeTableEntry * > rangetable
 
std::shared_ptr< Analyzer::Exprwhere_predicate
 
std::list< std::shared_ptr
< Analyzer::Expr > > 
group_by
 
std::shared_ptr< Analyzer::Exprhaving_predicate
 
std::list< OrderEntry > * order_by
 
Querynext_query
 
bool is_unionall
 
SQLStmtType stmt_type
 
int num_aggs
 
int result_table_id
 
std::list< int > result_col_list
 
std::vector< std::vector
< std::shared_ptr< TargetEntry > > > 
values_lists
 
int64_t limit
 
int64_t offset
 

Detailed Description

Definition at line 2778 of file Analyzer.h.

Constructor & Destructor Documentation

Analyzer::Query::Query ( )
inline

Definition at line 2780 of file Analyzer.h.

2781  : is_distinct(false)
2782  , where_predicate(nullptr)
2783  , having_predicate(nullptr)
2784  , order_by(nullptr)
2785  , next_query(nullptr)
2786  , is_unionall(false)
2787  , stmt_type(kSELECT)
2788  , num_aggs(0)
2789  , result_table_id(0)
2790  , limit(0)
2791  , offset(0) {}
Query * next_query
Definition: Analyzer.h:2849
SQLStmtType stmt_type
Definition: Analyzer.h:2851
int64_t offset
Definition: Analyzer.h:2857
std::shared_ptr< Analyzer::Expr > having_predicate
Definition: Analyzer.h:2847
std::shared_ptr< Analyzer::Expr > where_predicate
Definition: Analyzer.h:2845
int64_t limit
Definition: Analyzer.h:2856
std::list< OrderEntry > * order_by
Definition: Analyzer.h:2848
Analyzer::Query::~Query ( )
virtual

Definition at line 50 of file Analyzer.cpp.

References next_query, order_by, and rangetable.

50  {
51  for (auto p : rangetable) {
52  delete p;
53  }
54  delete order_by;
55  delete next_query;
56 }
Query * next_query
Definition: Analyzer.h:2849
std::vector< RangeTableEntry * > rangetable
Definition: Analyzer.h:2842
std::list< OrderEntry > * order_by
Definition: Analyzer.h:2848

Member Function Documentation

void Analyzer::Query::add_rte ( RangeTableEntry rte)

Definition at line 1479 of file Analyzer.cpp.

References rangetable.

Referenced by Parser::QuerySpec::analyze_from_clause().

1479  {
1480  rangetable.push_back(rte);
1481 }
std::vector< RangeTableEntry * > rangetable
Definition: Analyzer.h:2842

+ Here is the caller graph for this function:

void Analyzer::Query::add_tle ( std::shared_ptr< TargetEntry tle)
inline

Definition at line 2833 of file Analyzer.h.

References targetlist.

2833 { targetlist.push_back(tle); }
std::vector< std::shared_ptr< TargetEntry > > targetlist
Definition: Analyzer.h:2841
const std::list<std::shared_ptr<Analyzer::Expr> >& Analyzer::Query::get_group_by ( ) const
inline

Definition at line 2809 of file Analyzer.h.

References group_by.

Referenced by Parser::QuerySpec::analyze_having_clause().

2809  {
2810  return group_by;
2811  };
std::list< std::shared_ptr< Analyzer::Expr > > group_by
Definition: Analyzer.h:2846

+ Here is the caller graph for this function:

const Expr* Analyzer::Query::get_having_predicate ( ) const
inline

Definition at line 2812 of file Analyzer.h.

References having_predicate.

2812 { return having_predicate.get(); }
std::shared_ptr< Analyzer::Expr > having_predicate
Definition: Analyzer.h:2847
bool Analyzer::Query::get_is_distinct ( ) const
inline

Definition at line 2793 of file Analyzer.h.

References is_distinct.

Referenced by Parser::SelectStmt::analyze().

2793 { return is_distinct; }

+ Here is the caller graph for this function:

bool Analyzer::Query::get_is_unionall ( ) const
inline

Definition at line 2816 of file Analyzer.h.

References is_unionall.

2816 { return is_unionall; }
int64_t Analyzer::Query::get_limit ( ) const
inline

Definition at line 2834 of file Analyzer.h.

References limit.

2834 { return limit; }
int64_t limit
Definition: Analyzer.h:2856
const Query* Analyzer::Query::get_next_query ( ) const
inline

Definition at line 2814 of file Analyzer.h.

References next_query.

2814 { return next_query; }
Query * next_query
Definition: Analyzer.h:2849
int Analyzer::Query::get_num_aggs ( ) const
inline

Definition at line 2794 of file Analyzer.h.

References num_aggs.

Referenced by Parser::FunctionRef::analyze(), and Parser::QuerySpec::analyze_group_by().

2794 { return num_aggs; }

+ Here is the caller graph for this function:

int64_t Analyzer::Query::get_offset ( ) const
inline

Definition at line 2836 of file Analyzer.h.

References offset.

2836 { return offset; }
int64_t offset
Definition: Analyzer.h:2857
const std::list<OrderEntry>* Analyzer::Query::get_order_by ( ) const
inline

Definition at line 2813 of file Analyzer.h.

References order_by.

2813 { return order_by; }
std::list< OrderEntry > * order_by
Definition: Analyzer.h:2848
const std::vector<RangeTableEntry*>& Analyzer::Query::get_rangetable ( ) const
inline

Definition at line 2807 of file Analyzer.h.

References rangetable.

Referenced by Parser::ColumnRef::analyze(), and Parser::QuerySpec::analyze_select_clause().

2807 { return rangetable; }
std::vector< RangeTableEntry * > rangetable
Definition: Analyzer.h:2842

+ Here is the caller graph for this function:

const std::list<int>& Analyzer::Query::get_result_col_list ( ) const
inline

Definition at line 2818 of file Analyzer.h.

References result_col_list.

Referenced by Parser::InsertValuesStmt::analyze(), and RelAlgExecutor::executeSimpleInsert().

2818 { return result_col_list; }
std::list< int > result_col_list
Definition: Analyzer.h:2854

+ Here is the caller graph for this function:

int Analyzer::Query::get_result_table_id ( ) const
inline

Definition at line 2817 of file Analyzer.h.

References result_table_id.

Referenced by Parser::InsertValuesStmt::analyze(), and RelAlgExecutor::executeSimpleInsert().

2817 { return result_table_id; }

+ Here is the caller graph for this function:

RangeTableEntry* Analyzer::Query::get_rte ( int  rte_idx) const
inline

Definition at line 2831 of file Analyzer.h.

References rangetable.

Referenced by Parser::ColumnRef::analyze(), and Parser::QuerySpec::analyze_select_clause().

2831 { return rangetable[rte_idx]; }
std::vector< RangeTableEntry * > rangetable
Definition: Analyzer.h:2842

+ Here is the caller graph for this function:

int Analyzer::Query::get_rte_idx ( const std::string &  range_var_name) const

Definition at line 1468 of file Analyzer.cpp.

References setup::name, and rangetable.

Referenced by Parser::ColumnRef::analyze(), and Parser::QuerySpec::analyze_select_clause().

1468  {
1469  int rte_idx = 0;
1470  for (auto rte : rangetable) {
1471  if (rte->get_rangevar() == name) {
1472  return rte_idx;
1473  }
1474  rte_idx++;
1475  }
1476  return -1;
1477 }
std::vector< RangeTableEntry * > rangetable
Definition: Analyzer.h:2842
string name
Definition: setup.in.py:72

+ Here is the caller graph for this function:

SQLStmtType Analyzer::Query::get_stmt_type ( ) const
inline

Definition at line 2815 of file Analyzer.h.

References stmt_type.

2815 { return stmt_type; }
SQLStmtType stmt_type
Definition: Analyzer.h:2851
const std::vector<std::shared_ptr<TargetEntry> >& Analyzer::Query::get_targetlist ( ) const
inline

Definition at line 2795 of file Analyzer.h.

References targetlist.

Referenced by Parser::ColumnRef::analyze(), Parser::SelectStmt::analyze(), and Parser::QuerySpec::analyze_group_by().

2795  {
2796  return targetlist;
2797  }
std::vector< std::shared_ptr< TargetEntry > > targetlist
Definition: Analyzer.h:2841

+ Here is the caller graph for this function:

std::vector<std::shared_ptr<TargetEntry> >& Analyzer::Query::get_targetlist_nonconst ( )
inline

Definition at line 2798 of file Analyzer.h.

References targetlist.

Referenced by Parser::QuerySpec::analyze_select_clause().

2798  {
2799  return targetlist;
2800  }
std::vector< std::shared_ptr< TargetEntry > > targetlist
Definition: Analyzer.h:2841

+ Here is the caller graph for this function:

const std::vector<std::vector<std::shared_ptr<TargetEntry> > >& Analyzer::Query::get_values_lists ( ) const
inline

Definition at line 2801 of file Analyzer.h.

References values_lists.

Referenced by Parser::InsertValuesStmt::analyze(), and RelAlgExecutor::executeSimpleInsert().

2801  {
2802  return values_lists;
2803  }
std::vector< std::vector< std::shared_ptr< TargetEntry > > > values_lists
Definition: Analyzer.h:2855

+ Here is the caller graph for this function:

std::vector<std::vector<std::shared_ptr<TargetEntry> > >& Analyzer::Query::get_values_lists ( )
inline

Definition at line 2804 of file Analyzer.h.

References values_lists.

2804  {
2805  return values_lists;
2806  }
std::vector< std::vector< std::shared_ptr< TargetEntry > > > values_lists
Definition: Analyzer.h:2855
const Expr* Analyzer::Query::get_where_predicate ( ) const
inline

Definition at line 2808 of file Analyzer.h.

References where_predicate.

2808 { return where_predicate.get(); }
std::shared_ptr< Analyzer::Expr > where_predicate
Definition: Analyzer.h:2845
void Analyzer::Query::set_group_by ( std::list< std::shared_ptr< Analyzer::Expr >> &  g)
inline

Definition at line 2823 of file Analyzer.h.

References group_by.

Referenced by Parser::QuerySpec::analyze_group_by().

2823 { group_by = g; }
std::list< std::shared_ptr< Analyzer::Expr > > group_by
Definition: Analyzer.h:2846

+ Here is the caller graph for this function:

void Analyzer::Query::set_having_predicate ( std::shared_ptr< Analyzer::Expr p)
inline

Definition at line 2824 of file Analyzer.h.

References having_predicate.

Referenced by Parser::QuerySpec::analyze_having_clause().

2824 { having_predicate = p; }
std::shared_ptr< Analyzer::Expr > having_predicate
Definition: Analyzer.h:2847

+ Here is the caller graph for this function:

void Analyzer::Query::set_is_distinct ( bool  d)
inline

Definition at line 2821 of file Analyzer.h.

References is_distinct.

Referenced by Parser::QuerySpec::analyze().

2821 { is_distinct = d; }

+ Here is the caller graph for this function:

void Analyzer::Query::set_is_unionall ( bool  u)
inline

Definition at line 2827 of file Analyzer.h.

References is_unionall.

Referenced by Parser::UnionQuery::analyze().

2827 { is_unionall = u; }

+ Here is the caller graph for this function:

void Analyzer::Query::set_limit ( int64_t  l)
inline

Definition at line 2835 of file Analyzer.h.

References limit.

Referenced by Parser::SelectStmt::analyze().

2835 { limit = l; }
int64_t limit
Definition: Analyzer.h:2856

+ Here is the caller graph for this function:

void Analyzer::Query::set_next_query ( Query q)
inline

Definition at line 2826 of file Analyzer.h.

References next_query.

Referenced by Parser::UnionQuery::analyze().

2826 { next_query = q; }
Query * next_query
Definition: Analyzer.h:2849

+ Here is the caller graph for this function:

void Analyzer::Query::set_num_aggs ( int  a)
inline

Definition at line 2829 of file Analyzer.h.

References anonymous_namespace{Utm.h}::a, and num_aggs.

Referenced by Parser::FunctionRef::analyze().

2829 { num_aggs = a; }
constexpr double a
Definition: Utm.h:32

+ Here is the caller graph for this function:

void Analyzer::Query::set_offset ( int64_t  o)
inline

Definition at line 2837 of file Analyzer.h.

References offset.

Referenced by Parser::SelectStmt::analyze().

2837 { offset = o; }
int64_t offset
Definition: Analyzer.h:2857

+ Here is the caller graph for this function:

void Analyzer::Query::set_order_by ( std::list< OrderEntry > *  o)
inline

Definition at line 2825 of file Analyzer.h.

References order_by.

Referenced by Parser::SelectStmt::analyze().

2825 { order_by = o; }
std::list< OrderEntry > * order_by
Definition: Analyzer.h:2848

+ Here is the caller graph for this function:

void Analyzer::Query::set_result_col_list ( const std::list< int > &  col_list)
inline

Definition at line 2819 of file Analyzer.h.

References result_col_list.

Referenced by Parser::InsertStmt::analyze().

2819 { result_col_list = col_list; }
std::list< int > result_col_list
Definition: Analyzer.h:2854

+ Here is the caller graph for this function:

void Analyzer::Query::set_result_table_id ( int  id)
inline

Definition at line 2820 of file Analyzer.h.

References result_table_id.

Referenced by Parser::InsertStmt::analyze().

2820 { result_table_id = id; }

+ Here is the caller graph for this function:

void Analyzer::Query::set_stmt_type ( SQLStmtType  t)
inline

Definition at line 2828 of file Analyzer.h.

References stmt_type.

Referenced by Parser::SelectStmt::analyze(), and Parser::InsertStmt::analyze().

2828 { stmt_type = t; }
SQLStmtType stmt_type
Definition: Analyzer.h:2851

+ Here is the caller graph for this function:

void Analyzer::Query::set_where_predicate ( std::shared_ptr< Analyzer::Expr p)
inline

Definition at line 2822 of file Analyzer.h.

References where_predicate.

Referenced by Parser::QuerySpec::analyze_where_clause().

2822 { where_predicate = p; }
std::shared_ptr< Analyzer::Expr > where_predicate
Definition: Analyzer.h:2845

+ Here is the caller graph for this function:

Member Data Documentation

std::list<std::shared_ptr<Analyzer::Expr> > Analyzer::Query::group_by
private

Definition at line 2846 of file Analyzer.h.

Referenced by get_group_by(), and set_group_by().

std::shared_ptr<Analyzer::Expr> Analyzer::Query::having_predicate
private

Definition at line 2847 of file Analyzer.h.

Referenced by get_having_predicate(), and set_having_predicate().

bool Analyzer::Query::is_unionall
private

Definition at line 2850 of file Analyzer.h.

Referenced by get_is_unionall(), and set_is_unionall().

int64_t Analyzer::Query::limit
private

Definition at line 2856 of file Analyzer.h.

Referenced by get_limit(), and set_limit().

Query* Analyzer::Query::next_query
private

Definition at line 2849 of file Analyzer.h.

Referenced by get_next_query(), set_next_query(), and ~Query().

int Analyzer::Query::num_aggs
private

Definition at line 2852 of file Analyzer.h.

Referenced by get_num_aggs(), and set_num_aggs().

int64_t Analyzer::Query::offset
private

Definition at line 2857 of file Analyzer.h.

Referenced by get_offset(), and set_offset().

std::list<OrderEntry>* Analyzer::Query::order_by
private

Definition at line 2848 of file Analyzer.h.

Referenced by get_order_by(), set_order_by(), and ~Query().

std::vector<RangeTableEntry*> Analyzer::Query::rangetable
private

Definition at line 2842 of file Analyzer.h.

Referenced by add_rte(), get_rangetable(), get_rte(), get_rte_idx(), and ~Query().

std::list<int> Analyzer::Query::result_col_list
private

Definition at line 2854 of file Analyzer.h.

Referenced by get_result_col_list(), and set_result_col_list().

int Analyzer::Query::result_table_id
private

Definition at line 2853 of file Analyzer.h.

Referenced by get_result_table_id(), and set_result_table_id().

SQLStmtType Analyzer::Query::stmt_type
private

Definition at line 2851 of file Analyzer.h.

Referenced by get_stmt_type(), and set_stmt_type().

std::vector<std::shared_ptr<TargetEntry> > Analyzer::Query::targetlist
private

Definition at line 2841 of file Analyzer.h.

Referenced by add_tle(), get_targetlist(), and get_targetlist_nonconst().

std::vector<std::vector<std::shared_ptr<TargetEntry> > > Analyzer::Query::values_lists
private

Definition at line 2855 of file Analyzer.h.

Referenced by get_values_lists().

std::shared_ptr<Analyzer::Expr> Analyzer::Query::where_predicate
private

Definition at line 2845 of file Analyzer.h.

Referenced by get_where_predicate(), and set_where_predicate().


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