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

#include <RangeTableEntry.h>

+ Collaboration diagram for Analyzer::RangeTableEntry:

Public Member Functions

 RangeTableEntry (const std::string &r, const TableDescriptor *t, Query *v)
 
virtual ~RangeTableEntry ()
 
const ColumnDescriptorget_column_desc (const Catalog_Namespace::Catalog &catalog, const std::string &name)
 
const std::list< const
ColumnDescriptor * > & 
get_column_descs () const
 
const std::string & get_rangevar () const
 
int32_t get_table_id () const
 
const std::string & get_table_name () const
 
const TableDescriptorget_table_desc () const
 
const Queryget_view_query () const
 
void expand_star_in_targetlist (const Catalog_Namespace::Catalog &catalog, std::vector< std::shared_ptr< TargetEntry >> &tlist, int rte_idx)
 
void add_all_column_descs (const Catalog_Namespace::Catalog &catalog)
 

Private Attributes

std::string rangevar
 
const TableDescriptortable_desc
 
std::list< const
ColumnDescriptor * > 
column_descs
 
Queryview_query
 

Detailed Description

Definition at line 31 of file RangeTableEntry.h.

Constructor & Destructor Documentation

Analyzer::RangeTableEntry::RangeTableEntry ( const std::string &  r,
const TableDescriptor t,
Query v 
)
inline

Definition at line 33 of file RangeTableEntry.h.

34  : rangevar(r), table_desc(t), view_query(v) {}
std::string rangevar
Query * view_query
const TableDescriptor * table_desc
Analyzer::RangeTableEntry::~RangeTableEntry ( )
virtual

Definition at line 23 of file RangeTableEntry.cpp.

References view_query.

23  {
24  if (view_query != nullptr) {
25  delete view_query;
26  }
27 }
Query * view_query

Member Function Documentation

void Analyzer::RangeTableEntry::add_all_column_descs ( const Catalog_Namespace::Catalog catalog)

Definition at line 45 of file RangeTableEntry.cpp.

References column_descs, Catalog_Namespace::Catalog::getAllColumnMetadataForTable(), table_desc, and TableDescriptor::tableId.

45  {
46  column_descs =
47  catalog.getAllColumnMetadataForTable(table_desc->tableId, true, true, true);
48 }
std::list< const ColumnDescriptor * > column_descs
std::list< const ColumnDescriptor * > getAllColumnMetadataForTable(const int tableId, const bool fetchSystemColumns, const bool fetchVirtualColumns, const bool fetchPhysicalColumns) const
Returns a list of pointers to constant ColumnDescriptor structs for all the columns from a particular...
Definition: Catalog.cpp:2175
const TableDescriptor * table_desc

+ Here is the call graph for this function:

void Analyzer::RangeTableEntry::expand_star_in_targetlist ( const Catalog_Namespace::Catalog catalog,
std::vector< std::shared_ptr< TargetEntry >> &  tlist,
int  rte_idx 
)

Definition at line 50 of file RangeTableEntry.cpp.

References column_descs, Catalog_Namespace::Catalog::getAllColumnMetadataForTable(), Catalog_Namespace::Catalog::getDatabaseId(), table_desc, and TableDescriptor::tableId.

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

53  {
54  column_descs =
55  catalog.getAllColumnMetadataForTable(table_desc->tableId, false, true, true);
56  for (auto col_desc : column_descs) {
57  auto cv = makeExpr<ColumnVar>(
58  col_desc->columnType,
60  catalog.getDatabaseId(), table_desc->tableId, col_desc->columnId},
61  rte_idx);
62  auto tle = std::make_shared<TargetEntry>(col_desc->columnName, cv, false);
63  tlist.push_back(tle);
64  }
65 }
std::list< const ColumnDescriptor * > column_descs
int getDatabaseId() const
Definition: Catalog.h:326
std::list< const ColumnDescriptor * > getAllColumnMetadataForTable(const int tableId, const bool fetchSystemColumns, const bool fetchVirtualColumns, const bool fetchPhysicalColumns) const
Returns a list of pointers to constant ColumnDescriptor structs for all the columns from a particular...
Definition: Catalog.cpp:2175
const TableDescriptor * table_desc

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const ColumnDescriptor * Analyzer::RangeTableEntry::get_column_desc ( const Catalog_Namespace::Catalog catalog,
const std::string &  name 
)

Definition at line 67 of file RangeTableEntry.cpp.

References column_descs, Catalog_Namespace::Catalog::getMetadataForColumn(), table_desc, and TableDescriptor::tableId.

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

69  {
70  for (auto cd : column_descs) {
71  if (cd->columnName == name) {
72  return cd;
73  }
74  }
76  if (cd != nullptr) {
77  column_descs.push_back(cd);
78  }
79  return cd;
80 }
std::list< const ColumnDescriptor * > column_descs
const ColumnDescriptor * getMetadataForColumn(int tableId, const std::string &colName) const
specifies the content in-memory of a row in the column metadata table
const TableDescriptor * table_desc
string name
Definition: setup.in.py:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const std::list< const ColumnDescriptor * > & Analyzer::RangeTableEntry::get_column_descs ( ) const

Definition at line 29 of file RangeTableEntry.cpp.

References column_descs.

29  {
30  return column_descs;
31 }
std::list< const ColumnDescriptor * > column_descs
const std::string& Analyzer::RangeTableEntry::get_rangevar ( ) const
inline

Definition at line 45 of file RangeTableEntry.h.

References rangevar.

45 { return rangevar; }
std::string rangevar
const TableDescriptor * Analyzer::RangeTableEntry::get_table_desc ( ) const

Definition at line 41 of file RangeTableEntry.cpp.

References table_desc.

41  {
42  return table_desc;
43 }
const TableDescriptor * table_desc
int32_t Analyzer::RangeTableEntry::get_table_id ( ) const

Definition at line 33 of file RangeTableEntry.cpp.

References table_desc, and TableDescriptor::tableId.

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

33  {
34  return table_desc->tableId;
35 }
const TableDescriptor * table_desc

+ Here is the caller graph for this function:

const std::string & Analyzer::RangeTableEntry::get_table_name ( ) const

Definition at line 37 of file RangeTableEntry.cpp.

References table_desc, and TableDescriptor::tableName.

37  {
38  return table_desc->tableName;
39 }
std::string tableName
const TableDescriptor * table_desc
const Query* Analyzer::RangeTableEntry::get_view_query ( ) const
inline

Definition at line 49 of file RangeTableEntry.h.

References view_query.

49 { return view_query; }
Query * view_query

Member Data Documentation

std::list<const ColumnDescriptor*> Analyzer::RangeTableEntry::column_descs
private
std::string Analyzer::RangeTableEntry::rangevar
private

Definition at line 56 of file RangeTableEntry.h.

Referenced by get_rangevar().

const TableDescriptor* Analyzer::RangeTableEntry::table_desc
private
Query* Analyzer::RangeTableEntry::view_query
private

Definition at line 60 of file RangeTableEntry.h.

Referenced by get_view_query(), and ~RangeTableEntry().


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