OmniSciDB  c07336695a
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

◆ RangeTableEntry()

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

Definition at line 33 of file RangeTableEntry.h.

References get_column_desc(), get_column_descs(), and ~RangeTableEntry().

34  : rangevar(r), table_desc(t), view_query(v) {}
std::string rangevar
Query * view_query
T v(const TargetValue &r)
const TableDescriptor * table_desc
+ Here is the call graph for this function:

◆ ~RangeTableEntry()

Analyzer::RangeTableEntry::~RangeTableEntry ( )
virtual

Definition at line 23 of file RangeTableEntry.cpp.

References view_query.

Referenced by RangeTableEntry().

23  {
24  if (view_query != nullptr) {
25  delete view_query;
26  }
27 }
Query * view_query
+ Here is the caller graph for this function:

Member Function Documentation

◆ add_all_column_descs()

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.

Referenced by get_view_query().

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:1579
const TableDescriptor * table_desc
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expand_star_in_targetlist()

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(), table_desc, and TableDescriptor::tableId.

Referenced by Parser::QuerySpec::analyze_select_clause(), and get_view_query().

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, table_desc->tableId, col_desc->columnId, rte_idx);
59  auto tle = std::make_shared<TargetEntry>(col_desc->columnName, cv, false);
60  tlist.push_back(tle);
61  }
62 }
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:1579
const TableDescriptor * table_desc
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_column_desc()

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

Definition at line 64 of file RangeTableEntry.cpp.

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

Referenced by Parser::ColumnRef::analyze(), and RangeTableEntry().

66  {
67  for (auto cd : column_descs) {
68  if (cd->columnName == name) {
69  return cd;
70  }
71  }
72  const ColumnDescriptor* cd = catalog.getMetadataForColumn(table_desc->tableId, name);
73  if (cd != nullptr) {
74  column_descs.push_back(cd);
75  }
76  return cd;
77 }
const ColumnDescriptor * getMetadataForColumn(int tableId, const std::string &colName) const
std::list< const ColumnDescriptor * > column_descs
specifies the content in-memory of a row in the column metadata table
const TableDescriptor * table_desc
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_column_descs()

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

Definition at line 29 of file RangeTableEntry.cpp.

References column_descs.

Referenced by RangeTableEntry(), and Planner::Scan::Scan().

29  {
30  return column_descs;
31 }
std::list< const ColumnDescriptor * > column_descs
+ Here is the caller graph for this function:

◆ get_rangevar()

const std::string& Analyzer::RangeTableEntry::get_rangevar ( ) const
inline

Definition at line 45 of file RangeTableEntry.h.

References get_table_desc(), get_table_id(), get_table_name(), and rangevar.

45 { return rangevar; }
std::string rangevar
+ Here is the call graph for this function:

◆ get_table_desc()

const TableDescriptor * Analyzer::RangeTableEntry::get_table_desc ( ) const

Definition at line 41 of file RangeTableEntry.cpp.

References table_desc.

Referenced by get_rangevar().

41  {
42  return table_desc;
43 }
const TableDescriptor * table_desc
+ Here is the caller graph for this function:

◆ get_table_id()

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(), get_rangevar(), and Planner::Scan::Scan().

33  {
34  return table_desc->tableId;
35 }
const TableDescriptor * table_desc
+ Here is the caller graph for this function:

◆ get_table_name()

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

Definition at line 37 of file RangeTableEntry.cpp.

References table_desc, and TableDescriptor::tableName.

Referenced by get_rangevar().

37  {
38  return table_desc->tableName;
39 }
std::string tableName
const TableDescriptor * table_desc
+ Here is the caller graph for this function:

◆ get_view_query()

const Query* Analyzer::RangeTableEntry::get_view_query ( ) const
inline

Definition at line 49 of file RangeTableEntry.h.

References add_all_column_descs(), expand_star_in_targetlist(), and view_query.

49 { return view_query; }
Query * view_query
+ Here is the call graph for this function:

Member Data Documentation

◆ column_descs

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

◆ rangevar

std::string Analyzer::RangeTableEntry::rangevar
private

Definition at line 56 of file RangeTableEntry.h.

Referenced by get_rangevar().

◆ table_desc

const TableDescriptor* Analyzer::RangeTableEntry::table_desc
private

◆ view_query

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: