Column-oriented GPU-accelerated Database Management System
CoGaDB
CoGaDB::BaseTable Class Reference

#include <base_table.hpp>

Inheritance diagram for CoGaDB::BaseTable:
Collaboration diagram for CoGaDB::BaseTable:

List of all members.

Public Types

typedef
shared_pointer_namespace::shared_ptr
< BaseTable
TablePtr

Public Member Functions

 BaseTable (const std::string &name, const TableSchema &schema)
virtual ~BaseTable ()
const std::string & getName () const throw ()
const TableSchema getSchema () const throw ()
virtual void print ()=0
virtual bool store ()=0
virtual bool load ()=0
virtual bool loadDatafromFile (std::string filepath)=0
virtual const TablePtr materialize () const =0
virtual bool addColumn (ColumnPtr)=0
virtual unsigned int getNumberofRows () const throw ()
unsigned int getSizeinBytes () const throw ()
void printSchema () const
virtual bool isMaterialized () const =0 throw ()
virtual const Tuple fetchTuple (const TID &id) const =0
virtual bool insert (const Tuple &t)=0
virtual bool update (const std::string &attribute_name, const boost::any &value)=0
virtual bool remove (const std::string &attribute_name, const boost::any &value)=0
virtual const ColumnPtr getColumnbyName (const std::string &column_name) const =0 throw ()

Static Public Member Functions

static const TablePtr createResultTable (TablePtr table, PositionListPtr tids, MaterializationStatus mat_stat, const std::string &operation_name)
static const TablePtr selection (TablePtr table, const std::string &column_name, const boost::any &value_for_comparison, const ValueComparator &comp, MaterializationStatus mat_stat=MATERIALIZE, ParallelizationMode comp_mode=SERIAL, const ComputeDevice comp_dev=CPU)
static const TablePtr selection (TablePtr table, const KNF_Selection_Expression &, MaterializationStatus mat_stat=MATERIALIZE, ParallelizationMode comp_mode=SERIAL)
static const TablePtr selection (TablePtr table, const Disjunction &disjunction, MaterializationStatus mat_stat=MATERIALIZE, ParallelizationMode comp_mode=SERIAL)
static const TablePtr projection (TablePtr table, const std::list< std::string > &columns_to_select, MaterializationStatus mat_stat=MATERIALIZE, const ComputeDevice comp_dev=CPU)
static const TablePtr join (TablePtr table1, const std::string &join_column_table1, TablePtr table2, const std::string &join_column_table2, JoinAlgorithm join_alg=SORT_MERGE_JOIN, MaterializationStatus mat_stat=MATERIALIZE, const ComputeDevice comp_dev=CPU)
static const TablePtr crossjoin (TablePtr table1, TablePtr table2, MaterializationStatus mat_stat=MATERIALIZE)
static const TablePtr sort (TablePtr table, const std::string &column_name, SortOrder order=ASCENDING, MaterializationStatus mat_stat=MATERIALIZE, ComputeDevice comp_dev=CPU)
static const TablePtr sort (TablePtr table, const std::list< std::string > &column_names, SortOrder order=ASCENDING, MaterializationStatus mat_stat=MATERIALIZE, ComputeDevice comp_dev=CPU)
static const TablePtr groupby (TablePtr table, const std::string &grouping_column, const std::string &aggregation_column, const std::string &result_column_name, AggregationMethod agg_meth=SUM, ComputeDevice comp_dev=CPU)
static const TablePtr groupby (TablePtr table, const std::list< std::string > &grouping_columns, std::list< std::pair< std::string, AggregationMethod > > aggregation_functions, ComputeDevice comp_dev=CPU)
static TablePtr ColumnConstantOperation (TablePtr tab, const std::string &col_name, const boost::any &value, const std::string &result_col_name, ColumnAlgebraOperation operation, const ComputeDevice comp_dev=CPU)
 adds a new column named result_col_name to the table, which is the result of col_name <operation> value
static TablePtr ColumnAlgebraOperation (TablePtr tab, const std::string &col1_name, const std::string &col2_name, const std::string &result_col_name, ColumnAlgebraOperation operation, const ComputeDevice comp_dev=CPU)
 adds a new column named result_col_name to the table, which is the result of col1_name <operation> col2_name
static TablePtr AddConstantValueColumnOperation (TablePtr tab, const std::string &col_name, AttributeType type, const boost::any &value, const ComputeDevice comp_dev=CPU)
 fills a Column #rows times with value and append to table

Protected Member Functions

virtual const std::vector
< ColumnPtr > & 
getColumns () const =0

Protected Attributes

std::string name_
TableSchema schema_

Friends

class LookupColumn

Member Typedef Documentation

typedef shared_pointer_namespace::shared_ptr<BaseTable> CoGaDB::BaseTable::TablePtr

Constructor & Destructor Documentation

CoGaDB::BaseTable::BaseTable ( const std::string &  name,
const TableSchema schema 
)

Member Function Documentation

virtual bool CoGaDB::BaseTable::addColumn ( ColumnPtr  ) [pure virtual]

Implemented in CoGaDB::LookupTable, and CoGaDB::Table.

TablePtr CoGaDB::BaseTable::AddConstantValueColumnOperation ( TablePtr  tab,
const std::string &  col_name,
AttributeType  type,
const boost::any &  value,
const ComputeDevice  comp_dev = CPU 
) [static]
TablePtr CoGaDB::BaseTable::ColumnAlgebraOperation ( TablePtr  tab,
const std::string &  col1_name,
const std::string &  col2_name,
const std::string &  result_col_name,
CoGaDB::ColumnAlgebraOperation  operation,
const ComputeDevice  comp_dev = CPU 
) [static]

adds a new column named result_col_name to the table, which is the result of col1_name <operation> col2_name

References CoGaDB::ADD, CoGaDB::gpu::copy_column_device_to_host(), CoGaDB::CPU, CoGaDB::createLookupTableforUnaryOperation(), CoGaDB::DIV, CoGaDB::GPU_Column_Cache::getGPUColumn(), CoGaDB::GPU, CoGaDB::GPU_Column_Cache::instance(), CoGaDB::MUL, CoGaDB::printGPUStatus(), and CoGaDB::SUB.

Here is the call graph for this function:

TablePtr CoGaDB::BaseTable::ColumnConstantOperation ( TablePtr  tab,
const std::string &  col_name,
const boost::any &  value,
const std::string &  result_col_name,
CoGaDB::ColumnAlgebraOperation  operation,
const ComputeDevice  comp_dev = CPU 
) [static]
const TablePtr CoGaDB::BaseTable::createResultTable ( TablePtr  table,
PositionListPtr  tids,
MaterializationStatus  mat_stat,
const std::string &  operation_name 
) [static]

References CoGaDB::createLookupTableforUnaryOperation(), CoGaDB::LOOKUP, CoGaDB::MATERIALIZE, and CoGaDB::quiet.

Referenced by selection(), sort(), and CoGaDB::query_processing::two_phase_physical_optimization_selection().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual const Tuple CoGaDB::BaseTable::fetchTuple ( const TID id) const [pure virtual]
virtual const ColumnPtr CoGaDB::BaseTable::getColumnbyName ( const std::string &  column_name) const throw () [pure virtual]
virtual const std::vector<ColumnPtr>& CoGaDB::BaseTable::getColumns ( ) const [protected, pure virtual]

Implemented in CoGaDB::LookupTable, CoGaDB::Table, and CoGaDB::RowTable.

Referenced by getNumberofRows(), and getSizeinBytes().

Here is the caller graph for this function:

unsigned int CoGaDB::BaseTable::getNumberofRows ( ) const throw () [virtual]

Reimplemented in CoGaDB::RowTable, and CoGaDB::Table.

References getColumns().

Referenced by CoGaDB::LookupTable::concatenate().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int CoGaDB::BaseTable::getSizeinBytes ( ) const throw () [inline]

References getColumns().

Here is the call graph for this function:

const TablePtr CoGaDB::BaseTable::groupby ( TablePtr  table,
const std::string &  grouping_column,
const std::string &  aggregation_column,
const std::string &  result_column_name,
AggregationMethod  agg_meth = SUM,
ComputeDevice  comp_dev = CPU 
) [static]
static const TablePtr CoGaDB::BaseTable::groupby ( TablePtr  table,
const std::list< std::string > &  grouping_columns,
std::list< std::pair< std::string, AggregationMethod > >  aggregation_functions,
ComputeDevice  comp_dev = CPU 
) [static]
virtual bool CoGaDB::BaseTable::insert ( const Tuple t) [pure virtual]
virtual bool CoGaDB::BaseTable::isMaterialized ( ) const throw () [pure virtual]
virtual bool CoGaDB::BaseTable::load ( ) [pure virtual]

tries to load BaseTable form database

Implemented in CoGaDB::RowTable, CoGaDB::LookupTable, and CoGaDB::Table.

virtual bool CoGaDB::BaseTable::loadDatafromFile ( std::string  filepath) [pure virtual]
virtual const TablePtr CoGaDB::BaseTable::materialize ( ) const [pure virtual]
virtual void CoGaDB::BaseTable::print ( ) [pure virtual]
void CoGaDB::BaseTable::printSchema ( ) const [inline]

References getSchema().

Here is the call graph for this function:

const TablePtr CoGaDB::BaseTable::projection ( TablePtr  table,
const std::list< std::string > &  columns_to_select,
MaterializationStatus  mat_stat = MATERIALIZE,
const ComputeDevice  comp_dev = CPU 
) [static]
virtual bool CoGaDB::BaseTable::remove ( const std::string &  attribute_name,
const boost::any &  value 
) [pure virtual]
const TablePtr CoGaDB::BaseTable::sort ( TablePtr  table,
const std::list< std::string > &  column_names,
SortOrder  order = ASCENDING,
MaterializationStatus  mat_stat = MATERIALIZE,
ComputeDevice  comp_dev = CPU 
) [static]

References CoGaDB::quiet, sort(), and CoGaDB::verbose.

Here is the call graph for this function:

virtual bool CoGaDB::BaseTable::store ( ) [pure virtual]

tries to store BaseTable in database

Implemented in CoGaDB::RowTable, CoGaDB::LookupTable, and CoGaDB::Table.

virtual bool CoGaDB::BaseTable::update ( const std::string &  attribute_name,
const boost::any &  value 
) [pure virtual]

Friends And Related Function Documentation

friend class LookupColumn [friend]

Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines