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

Detailed Description

Definition at line 1599 of file Analyzer.h.

Constructor & Destructor Documentation

Analyzer::Query::Query ( )
inline

Definition at line 1601 of file Analyzer.h.

1602  : is_distinct(false)
1603  , where_predicate(nullptr)
1604  , having_predicate(nullptr)
1605  , order_by(nullptr)
1606  , next_query(nullptr)
1607  , is_unionall(false)
1608  , stmt_type(kSELECT)
1609  , num_aggs(0)
1610  , result_table_id(0)
1611  , limit(0)
1612  , offset(0) {}
Query * next_query
Definition: Analyzer.h:1664
SQLStmtType stmt_type
Definition: Analyzer.h:1666
int64_t offset
Definition: Analyzer.h:1671
std::shared_ptr< Analyzer::Expr > having_predicate
Definition: Analyzer.h:1662
std::shared_ptr< Analyzer::Expr > where_predicate
Definition: Analyzer.h:1660
int64_t limit
Definition: Analyzer.h:1670
std::list< OrderEntry > * order_by
Definition: Analyzer.h:1663
Analyzer::Query::~Query ( )
virtual

Definition at line 52 of file Analyzer.cpp.

References next_query, order_by, and rangetable.

52  {
53  for (auto p : rangetable) {
54  delete p;
55  }
56  delete order_by;
57  delete next_query;
58 }
Query * next_query
Definition: Analyzer.h:1664
std::vector< RangeTableEntry * > rangetable
Definition: Analyzer.h:1657
std::list< OrderEntry > * order_by
Definition: Analyzer.h:1663

Member Function Documentation

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

Definition at line 1402 of file Analyzer.cpp.

References rangetable.

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

1402  {
1403  rangetable.push_back(rte);
1404 }
std::vector< RangeTableEntry * > rangetable
Definition: Analyzer.h:1657

+ Here is the caller graph for this function:

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

Definition at line 1648 of file Analyzer.h.

References targetlist.

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

Definition at line 1624 of file Analyzer.h.

References group_by.

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

1624  {
1625  return group_by;
1626  };
std::list< std::shared_ptr< Analyzer::Expr > > group_by
Definition: Analyzer.h:1661

+ Here is the caller graph for this function:

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

Definition at line 1627 of file Analyzer.h.

References having_predicate.

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

Definition at line 1614 of file Analyzer.h.

References is_distinct.

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

1614 { return is_distinct; }

+ Here is the caller graph for this function:

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

Definition at line 1631 of file Analyzer.h.

References is_unionall.

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

Definition at line 1649 of file Analyzer.h.

References limit.

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

Definition at line 1629 of file Analyzer.h.

References next_query.

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

Definition at line 1615 of file Analyzer.h.

References num_aggs.

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

1615 { return num_aggs; }

+ Here is the caller graph for this function:

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

Definition at line 1651 of file Analyzer.h.

References offset.

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

Definition at line 1628 of file Analyzer.h.

References order_by.

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

Definition at line 1622 of file Analyzer.h.

References rangetable.

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

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

+ Here is the caller graph for this function:

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

Definition at line 1633 of file Analyzer.h.

References result_col_list.

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

1633 { return result_col_list; }
std::list< int > result_col_list
Definition: Analyzer.h:1669

+ Here is the caller graph for this function:

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

Definition at line 1632 of file Analyzer.h.

References result_table_id.

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

1632 { 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 1646 of file Analyzer.h.

References rangetable.

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

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

+ Here is the caller graph for this function:

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

Definition at line 1391 of file Analyzer.cpp.

References setup::name, and rangetable.

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

1391  {
1392  int rte_idx = 0;
1393  for (auto rte : rangetable) {
1394  if (rte->get_rangevar() == name) {
1395  return rte_idx;
1396  }
1397  rte_idx++;
1398  }
1399  return -1;
1400 }
string name
Definition: setup.in.py:72
std::vector< RangeTableEntry * > rangetable
Definition: Analyzer.h:1657

+ Here is the caller graph for this function:

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

Definition at line 1630 of file Analyzer.h.

References stmt_type.

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

Definition at line 1616 of file Analyzer.h.

References targetlist.

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

1616  {
1617  return targetlist;
1618  }
std::vector< std::shared_ptr< TargetEntry > > targetlist
Definition: Analyzer.h:1656

+ Here is the caller graph for this function:

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

Definition at line 1619 of file Analyzer.h.

References targetlist.

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

1619  {
1620  return targetlist;
1621  }
std::vector< std::shared_ptr< TargetEntry > > targetlist
Definition: Analyzer.h:1656

+ Here is the caller graph for this function:

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

Definition at line 1623 of file Analyzer.h.

References where_predicate.

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

Definition at line 1638 of file Analyzer.h.

References group_by.

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

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

+ Here is the caller graph for this function:

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

Definition at line 1639 of file Analyzer.h.

References having_predicate.

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

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

+ Here is the caller graph for this function:

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

Definition at line 1636 of file Analyzer.h.

References test_fsi::d, and is_distinct.

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

1636 { is_distinct = d; }
tuple d
Definition: test_fsi.py:9

+ Here is the caller graph for this function:

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

Definition at line 1642 of file Analyzer.h.

References is_unionall.

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

1642 { is_unionall = u; }

+ Here is the caller graph for this function:

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

Definition at line 1650 of file Analyzer.h.

References limit.

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

1650 { limit = l; }
int64_t limit
Definition: Analyzer.h:1670

+ Here is the caller graph for this function:

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

Definition at line 1641 of file Analyzer.h.

References next_query.

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

1641 { next_query = q; }
Query * next_query
Definition: Analyzer.h:1664

+ Here is the caller graph for this function:

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

Definition at line 1644 of file Analyzer.h.

References num_aggs.

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

1644 { num_aggs = a; }

+ Here is the caller graph for this function:

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

Definition at line 1652 of file Analyzer.h.

References offset.

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

1652 { offset = o; }
int64_t offset
Definition: Analyzer.h:1671

+ Here is the caller graph for this function:

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

Definition at line 1640 of file Analyzer.h.

References order_by.

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

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

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

References result_col_list.

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

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

+ Here is the caller graph for this function:

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

Definition at line 1635 of file Analyzer.h.

References result_table_id.

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

1635 { result_table_id = id; }

+ Here is the caller graph for this function:

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

Definition at line 1643 of file Analyzer.h.

References stmt_type, and t.

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

1643 { stmt_type = t; }
SQLStmtType stmt_type
Definition: Analyzer.h:1666
char * t

+ Here is the caller graph for this function:

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

Definition at line 1637 of file Analyzer.h.

References where_predicate.

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

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

+ 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 1661 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 1662 of file Analyzer.h.

Referenced by get_having_predicate(), and set_having_predicate().

bool Analyzer::Query::is_unionall
private

Definition at line 1665 of file Analyzer.h.

Referenced by get_is_unionall(), and set_is_unionall().

int64_t Analyzer::Query::limit
private

Definition at line 1670 of file Analyzer.h.

Referenced by get_limit(), and set_limit().

Query* Analyzer::Query::next_query
private

Definition at line 1664 of file Analyzer.h.

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

int Analyzer::Query::num_aggs
private

Definition at line 1667 of file Analyzer.h.

Referenced by get_num_aggs(), and set_num_aggs().

int64_t Analyzer::Query::offset
private

Definition at line 1671 of file Analyzer.h.

Referenced by get_offset(), and set_offset().

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

Definition at line 1663 of file Analyzer.h.

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

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

Definition at line 1657 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 1669 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 1668 of file Analyzer.h.

Referenced by get_result_table_id(), and set_result_table_id().

SQLStmtType Analyzer::Query::stmt_type
private

Definition at line 1666 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 1656 of file Analyzer.h.

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

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

Definition at line 1660 of file Analyzer.h.

Referenced by get_where_predicate(), and set_where_predicate().


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