Column-oriented GPU-accelerated Database Management System
CoGaDB
|
#include <lookup_table.hpp>
Public Types | |
typedef shared_pointer_namespace::shared_ptr < LookupTable > | LookupTablePtr |
Public Member Functions | |
LookupTable (const std::string &name, const TableSchema &schema, const std::vector< LookupColumnPtr > &lookup_columns, const std::vector< ColumnPtr > lookup_arrays_, const std::vector< ColumnPtr > dense_value_arrays=std::vector< ColumnPtr >()) | |
virtual | ~LookupTable () |
virtual void | print () |
virtual bool | store () |
virtual bool | load () |
virtual bool | loadDatafromFile (std::string filepath) |
virtual const TablePtr | materialize () const |
virtual bool | addColumn (ColumnPtr) |
virtual bool | isMaterialized () const throw () |
virtual const Tuple | fetchTuple (const TID &id) const |
virtual bool | insert (const Tuple &t) |
virtual bool | update (const std::string &attribute_name, const boost::any &value) |
virtual bool | remove (const std::string &attribute_name, const boost::any &value) |
virtual const ColumnPtr | getColumnbyName (const std::string &column_name) const throw () |
const std::vector < LookupColumnPtr > & | getLookupColumns () const |
const ColumnVector & | getDenseValueColumns () |
Static Public Member Functions | |
static const LookupTablePtr | aggregate (const std::string &result_lookup_table_name, const LookupTable &lookup_table, const LookupColumn &lookup_col) |
aggregates LookupTable wrt Lookup Column, which indexes the LookupTable. IT takes care of copying the LookupColumns and their corresponding PostitionList. Furthermore, it calls functions which createa new LookupArraylist, which represents the columns of the Table (a view, to be more precise) represented by the Lookup Table | |
static const LookupTablePtr | concatenate (const std::string &result_lookup_table_name, const LookupTable &lookup_table1, const LookupTable &lookup_table2) |
Protected Member Functions | |
virtual const std::vector < ColumnPtr > & | getColumns () const |
const ColumnVectorPtr | getLookupArrays () |
Private Attributes | |
std::vector< LookupColumnPtr > | lookup_columns_ |
std::vector< ColumnPtr > | lookup_arrays_to_real_columns_ |
std::vector< ColumnPtr > | appended_dense_value_columns_ |
std::vector< ColumnPtr > | all_columns_ |
typedef shared_pointer_namespace::shared_ptr<LookupTable> CoGaDB::LookupTable::LookupTablePtr |
CoGaDB::LookupTable::LookupTable | ( | const std::string & | name, |
const TableSchema & | schema, | ||
const std::vector< LookupColumnPtr > & | lookup_columns, | ||
const std::vector< ColumnPtr > | lookup_arrays_, | ||
const std::vector< ColumnPtr > | dense_value_arrays = std::vector<ColumnPtr>() |
||
) |
References all_columns_, appended_dense_value_columns_, and lookup_arrays_to_real_columns_.
Referenced by aggregate(), and concatenate().
CoGaDB::LookupTable::~LookupTable | ( | ) | [virtual] |
bool CoGaDB::LookupTable::addColumn | ( | ColumnPtr | col | ) | [virtual] |
Implements CoGaDB::BaseTable.
References all_columns_, appended_dense_value_columns_, CoGaDB::BaseTable::getName(), CoGaDB::quiet, CoGaDB::BaseTable::schema_, and CoGaDB::verbose.
const LookupTablePtr CoGaDB::LookupTable::aggregate | ( | const std::string & | result_lookup_table_name, |
const LookupTable & | lookup_table, | ||
const LookupColumn & | lookup_col | ||
) | [static] |
aggregates LookupTable wrt Lookup Column, which indexes the LookupTable. IT takes care of copying the LookupColumns and their corresponding PostitionList. Furthermore, it calls functions which createa new LookupArraylist, which represents the columns of the Table (a view, to be more precise) represented by the Lookup Table
References appended_dense_value_columns_, CoGaDB::BaseTable::getSchema(), lookup_columns_, and LookupTable().
Referenced by CoGaDB::createLookupTableforUnaryOperation().
const LookupTablePtr CoGaDB::LookupTable::concatenate | ( | const std::string & | result_lookup_table_name, |
const LookupTable & | lookup_table1, | ||
const LookupTable & | lookup_table2 | ||
) | [static] |
References appended_dense_value_columns_, CoGaDB::BaseTable::getName(), CoGaDB::BaseTable::getNumberofRows(), lookup_arrays_to_real_columns_, lookup_columns_, LookupTable(), and CoGaDB::BaseTable::schema_.
Referenced by CoGaDB::BaseTable::crossjoin(), and CoGaDB::BaseTable::join().
const Tuple CoGaDB::LookupTable::fetchTuple | ( | const TID & | id | ) | const [virtual] |
Implements CoGaDB::BaseTable.
References appended_dense_value_columns_, and lookup_arrays_to_real_columns_.
Referenced by materialize().
const ColumnPtr CoGaDB::LookupTable::getColumnbyName | ( | const std::string & | column_name | ) | const throw () [virtual] |
Implements CoGaDB::BaseTable.
References COGADB_ERROR, CoGaDB::util::getName(), CoGaDB::quiet, and CoGaDB::verbose.
const std::vector< ColumnPtr > & CoGaDB::LookupTable::getColumns | ( | ) | const [protected, virtual] |
Implements CoGaDB::BaseTable.
References all_columns_.
References appended_dense_value_columns_.
const ColumnVectorPtr CoGaDB::LookupTable::getLookupArrays | ( | ) | [protected] |
References lookup_columns_, CoGaDB::BaseTable::name_, and CoGaDB::BaseTable::schema_.
const std::vector< LookupColumnPtr > & CoGaDB::LookupTable::getLookupColumns | ( | ) | const |
References lookup_columns_.
bool CoGaDB::LookupTable::insert | ( | const Tuple & | t | ) | [virtual] |
Implements CoGaDB::BaseTable.
bool CoGaDB::LookupTable::isMaterialized | ( | ) | const throw () [virtual] |
Implements CoGaDB::BaseTable.
bool CoGaDB::LookupTable::load | ( | ) | [virtual] |
tries to load table form database
Implements CoGaDB::BaseTable.
bool CoGaDB::LookupTable::loadDatafromFile | ( | std::string | filepath | ) | [virtual] |
Implements CoGaDB::BaseTable.
const TablePtr CoGaDB::LookupTable::materialize | ( | ) | const [virtual] |
Implements CoGaDB::BaseTable.
References fetchTuple(), CoGaDB::BaseTable::getName(), CoGaDB::BaseTable::getSchema(), and lookup_arrays_to_real_columns_.
void CoGaDB::LookupTable::print | ( | ) | [virtual] |
Implements CoGaDB::BaseTable.
References appended_dense_value_columns_, CoGaDB::BaseTable::getName(), lookup_arrays_to_real_columns_, lookup_columns_, and CoGaDB::BaseTable::name_.
bool CoGaDB::LookupTable::remove | ( | const std::string & | attribute_name, |
const boost::any & | value | ||
) | [virtual] |
Implements CoGaDB::BaseTable.
bool CoGaDB::LookupTable::store | ( | ) | [virtual] |
tries to store table in database
Implements CoGaDB::BaseTable.
bool CoGaDB::LookupTable::update | ( | const std::string & | attribute_name, |
const boost::any & | value | ||
) | [virtual] |
Implements CoGaDB::BaseTable.
std::vector<ColumnPtr> CoGaDB::LookupTable::all_columns_ [private] |
Referenced by addColumn(), getColumns(), and LookupTable().
std::vector<ColumnPtr> CoGaDB::LookupTable::appended_dense_value_columns_ [private] |
Referenced by addColumn(), aggregate(), concatenate(), fetchTuple(), getDenseValueColumns(), LookupTable(), and print().
std::vector<ColumnPtr> CoGaDB::LookupTable::lookup_arrays_to_real_columns_ [private] |
Referenced by concatenate(), fetchTuple(), LookupTable(), materialize(), and print().
std::vector<LookupColumnPtr> CoGaDB::LookupTable::lookup_columns_ [private] |
Referenced by aggregate(), concatenate(), getLookupArrays(), getLookupColumns(), and print().