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

This class represents a generic column, is the base class for all column classes and allows a uniform handling of columns. More...

#include <base_column.hpp>

Inheritance diagram for CoGaDB::ColumnBase:
Collaboration diagram for CoGaDB::ColumnBase:

List of all members.

Public Types

typedef
shared_pointer_namespace::shared_ptr
< ColumnBase
ColumnPtr
 defines a smart pointer to a ColumnBase Object
typedef
shared_pointer_namespace::shared_ptr
< ColumnBase
ColumnPtr
 defines a smart pointer to a ColumnBase Object

Public Member Functions

 ColumnBase (const std::string &name, AttributeType db_type)
virtual ~ColumnBase ()
virtual bool insert (const boost::any &new_Value)=0
 appends a value new_Value to end of column
virtual bool update (TID tid, const boost::any &new_Value)=0
 updates the value on position tid with a value new_Value
virtual bool update (PositionListPtr tids, const boost::any &new_value)=0
 updates the values specified by the position list with a value new_Value
virtual bool remove (TID tid)=0
 deletes the value on position tid
virtual bool remove (PositionListPtr tid)=0
 deletes the values defined in the position list
virtual bool clearContent ()=0
 deletes all values stored in the column
virtual const boost::any get (TID tid)=0
 generic function for fetching a value form a column (slow)
virtual void print () const =0 throw ()
 prints the content of a column
virtual size_t size () const =0 throw ()
 returns the number of values (rows) in a column
virtual unsigned int getSizeinBytes () const =0 throw ()
 returns the size in bytes the column consumes in main memory
virtual const ColumnPtr copy () const =0
 virtual copy constructor
virtual const PositionListPtr sort (SortOrder order=ASCENDING)=0
 sorts a column w.r.t. a SortOrder
virtual const PositionListPtr selection (const boost::any &value_for_comparison, const ValueComparator comp)=0
 filters the values of a column according to a filter condition consisting of a comparison value and a ValueComparator (=,<,>)
virtual const PositionListPtr parallel_selection (const boost::any &value_for_comparison, const ValueComparator comp, unsigned int number_of_threads)=0
 filters the values of a column in parallel according to a filter condition consisting of a comparison value and a ValueComparator (=,<,>)
virtual const PositionListPairPtr hash_join (ColumnPtr join_column)=0
 joins two columns using the hash join algorithm
virtual const PositionListPairPtr sort_merge_join (ColumnPtr join_column)=0
 joins two columns using the sort merge join algorithm
virtual const PositionListPairPtr nested_loop_join (ColumnPtr join_column)=0
 joins two columns using the nested loop join algorithm
virtual bool add (const boost::any &new_Value)=0
 adds constant to column
virtual bool add (ColumnPtr column)=0
 vector addition of two columns
virtual bool minus (const boost::any &new_Value)=0
 substracts constant from column
virtual bool minus (ColumnPtr column)=0
 vector substraction of two columns
virtual bool multiply (const boost::any &new_Value)=0
 multiply constant with column
virtual bool multiply (ColumnPtr column)=0
 multiply two columns A and B
virtual bool division (const boost::any &new_Value)=0
 devide values in column by a constant
virtual bool division (ColumnPtr column)=0
 devide column A with column B
virtual bool store (const std::string &path)=0
 store a column on the disc
virtual bool load (const std::string &path)=0
 load column from disc
virtual bool isMaterialized () const =0 throw ()
 use this method to determine whether the column is materialized or a Lookup Column
virtual bool isCompressed () const =0 throw ()
 use this method to determine whether the column is materialized or a Lookup Column
virtual const std::type_info & type () const =0 throw ()
 returns type information of internal values
AttributeType getType () const throw ()
 returns database type of column (as defined in "SQL" statement)
const std::string getName () const throw ()
 returns attribute name of column
 ColumnBase (const std::string &name, AttributeType db_type)
virtual ~ColumnBase ()
virtual bool insert (const boost::any &new_Value)=0
 appends a value new_Value to end of column
virtual bool update (TID tid, const boost::any &new_Value)=0
 updates the value on position tid with a value new_Value
virtual bool update (PositionListPtr tids, const boost::any &new_value)=0
 updates the values specified by the position list with a value new_Value
virtual bool remove (TID tid)=0
 deletes the value on position tid
virtual bool remove (PositionListPtr tid)=0
 deletes the values defined in the position list
virtual const boost::any get (TID tid)=0
 generic function for fetching a value form a column (slow)
virtual void print () const =0 throw ()
 prints the content of a column
virtual size_t size () const =0 throw ()
 returns the number of values (rows) in a column
virtual unsigned int getSizeinBytes () const =0 throw ()
 returns the size in bytes the column consumes in main memory
virtual const ColumnPtr copy () const =0
 virtual copy constructor
virtual const ColumnPtr gather (PositionListPtr tid_list)=0
 creates a new column by fetching all values identified by the tid_list
virtual const ColumnPtr materialize ()=0 throw ()
 materializes a column to a normal uncompressed column with dense values
virtual const PositionListPtr sort (SortOrder order=ASCENDING)=0
 sorts a column w.r.t. a SortOrder
virtual const PositionListPtr selection (const boost::any &value_for_comparison, const ValueComparator comp)=0
 filters the values of a column according to a filter condition consisting of a comparison value and a ValueComparator (=,<,>)
virtual const PositionListPtr selection (ColumnPtr, const ValueComparator comp)=0
 filters the values of a column according to a filter condition consisting of a comparison column and a ValueComparator (=,<,>). This implements the comparison of two values from two columns.
virtual const PositionListPtr parallel_selection (const boost::any &value_for_comparison, const ValueComparator comp, unsigned int number_of_threads)=0
 filters the values of a column in parallel according to a filter condition consisting of a comparison value and a ValueComparator (=,<,>)
virtual const PositionListPairPtr hash_join (ColumnPtr join_column)=0
 joins two columns using the hash join algorithm
virtual const PositionListPairPtr parallel_hash_join (ColumnPtr join_column, unsigned int number_of_threads)=0
 joins two columns using the hash join algorithm with a parallel pruning phase
virtual const PositionListPairPtr sort_merge_join (ColumnPtr join_column)=0
 joins two columns using the sort merge join algorithm
virtual const PositionListPairPtr nested_loop_join (ColumnPtr join_column)=0
 joins two columns using the nested loop join algorithm
virtual bool add (const boost::any &new_Value)=0
 adds constant to column
virtual bool add (ColumnPtr column)=0
 vector addition of two columns
virtual bool minus (const boost::any &new_Value)=0
 substracts constant from column
virtual bool minus (ColumnPtr column)=0
 vector substraction of two columns
virtual bool multiply (const boost::any &new_Value)=0
 multiply constant with column
virtual bool multiply (ColumnPtr column)=0
 multiply two columns A and B
virtual bool division (const boost::any &new_Value)=0
 devide values in column by a constant
virtual bool division (ColumnPtr column)=0
 devide column A with column B
virtual bool store (const std::string &path)=0
 store a column on the disc
virtual bool load (const std::string &path)=0
 load column from disc
virtual bool isMaterialized () const =0 throw ()
 use this method to determine whether the column is materialized or a Lookup Column
virtual bool isCompressed () const =0 throw ()
 use this method to determine whether the column is materialized or a Lookup Column
virtual const std::type_info & type () const =0 throw ()
 returns type information of internal values
AttributeType getType () const throw ()
 returns database type of column (as defined in "SQL" statement)
const std::string getName () const throw ()
 returns attribute name of column
void setName (const std::string &value) throw ()
 sets the attribute name of column
virtual bool is_equal (ColumnPtr column)=0
 test this column and column for equality
virtual int compareValuesAtIndexes (TID id1, TID id2)=0
 compares the values of this column on position id1 with value at position id2

Protected Attributes

std::string name_
 attribute name of the column
AttributeType db_type_
 database type of the column

Detailed Description

This class represents a generic column, is the base class for all column classes and allows a uniform handling of columns.

This class is indentended to be a base class, so it has a virtual destruktor and pure virtual methods, which need to be implemented in a derived class.

Author:
Sebastian Breß
Version:
0.2
Date:
2013

Member Typedef Documentation

typedef shared_pointer_namespace::shared_ptr<ColumnBase> CoGaDB::ColumnBase::ColumnPtr

defines a smart pointer to a ColumnBase Object

typedef shared_pointer_namespace::shared_ptr<ColumnBase> CoGaDB::ColumnBase::ColumnPtr

defines a smart pointer to a ColumnBase Object


Constructor & Destructor Documentation

CoGaDB::ColumnBase::ColumnBase ( const std::string &  name,
AttributeType  db_type 
)
CoGaDB::ColumnBase::ColumnBase ( const std::string &  name,
AttributeType  db_type 
)
virtual CoGaDB::ColumnBase::~ColumnBase ( ) [virtual]

Member Function Documentation

virtual bool CoGaDB::ColumnBase::add ( const boost::any &  new_Value) [pure virtual]
virtual bool CoGaDB::ColumnBase::add ( ColumnPtr  column) [pure virtual]

vector addition of two columns

for all indeces i holds the following property: C[i]=A[i]+B[i]

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual bool CoGaDB::ColumnBase::add ( const boost::any &  new_Value) [pure virtual]
virtual bool CoGaDB::ColumnBase::add ( ColumnPtr  column) [pure virtual]

vector addition of two columns

for all indeces i holds the following property: C[i]=A[i]+B[i]

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual int CoGaDB::ColumnBase::compareValuesAtIndexes ( TID  id1,
TID  id2 
) [pure virtual]

compares the values of this column on position id1 with value at position id2

Implemented in CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual bool CoGaDB::ColumnBase::division ( const boost::any &  new_Value) [pure virtual]

devide values in column by a constant

for all indeces i holds the following property: B[i]=A[i]/new_Value

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual bool CoGaDB::ColumnBase::division ( ColumnPtr  column) [pure virtual]
virtual bool CoGaDB::ColumnBase::division ( const boost::any &  new_Value) [pure virtual]

devide values in column by a constant

for all indeces i holds the following property: B[i]=A[i]/new_Value

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual bool CoGaDB::ColumnBase::division ( ColumnPtr  column) [pure virtual]
virtual const ColumnPtr CoGaDB::ColumnBase::gather ( PositionListPtr  tid_list) [pure virtual]

creates a new column by fetching all values identified by the tid_list

Returns:
a ColumnPtr that contains only values from the tid_list

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::LookupArray< T >, CoGaDB::Column< T >, CoGaDB::CompressedColumn< T >, and CoGaDB::CompressedColumn< std::string >.

const string CoGaDB::ColumnBase::getName ( ) const throw ()

returns attribute name of column

Returns:
attribute name of column

References name_.

Referenced by CoGaDB::ColumnBaseTyped< T >::parallel_hash_join().

Here is the caller graph for this function:

const std::string CoGaDB::ColumnBase::getName ( ) const throw ()

returns attribute name of column

Returns:
attribute name of column

returns database type of column (as defined in "SQL" statement)

References db_type_.

returns database type of column (as defined in "SQL" statement)

virtual const PositionListPairPtr CoGaDB::ColumnBase::hash_join ( ColumnPtr  join_column) [pure virtual]

joins two columns using the hash join algorithm

Returns:
PositionListPairPtr to a PositionListPair, which represents the result

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual const PositionListPairPtr CoGaDB::ColumnBase::hash_join ( ColumnPtr  join_column) [pure virtual]

joins two columns using the hash join algorithm

Returns:
PositionListPairPtr to a PositionListPair, which represents the result

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual bool CoGaDB::ColumnBase::is_equal ( ColumnPtr  column) [pure virtual]

test this column and column for equality

Returns:
returns true if columns are equal and false otherwise

Implemented in CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual const ColumnPtr CoGaDB::ColumnBase::materialize ( ) throw () [pure virtual]

materializes a column to a normal uncompressed column with dense values

Returns:
a ColumnPtr to an materialized column

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::LookupArray< T >, CoGaDB::CompressedColumn< T >, CoGaDB::CompressedColumn< std::string >, and CoGaDB::Column< T >.

virtual bool CoGaDB::ColumnBase::minus ( const boost::any &  new_Value) [pure virtual]

substracts constant from column

for all indeces i holds the following property: B[i]=A[i]-new_Value

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual bool CoGaDB::ColumnBase::minus ( ColumnPtr  column) [pure virtual]

vector substraction of two columns

for all indeces i holds the following property: C[i]=A[i]-B[i]

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual bool CoGaDB::ColumnBase::minus ( const boost::any &  new_Value) [pure virtual]

substracts constant from column

for all indeces i holds the following property: B[i]=A[i]-new_Value

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual bool CoGaDB::ColumnBase::minus ( ColumnPtr  column) [pure virtual]

vector substraction of two columns

for all indeces i holds the following property: C[i]=A[i]-B[i]

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual bool CoGaDB::ColumnBase::multiply ( const boost::any &  new_Value) [pure virtual]

multiply constant with column

for all indeces i holds the following property: B[i]=A[i]*new_Value

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual bool CoGaDB::ColumnBase::multiply ( ColumnPtr  column) [pure virtual]
virtual bool CoGaDB::ColumnBase::multiply ( const boost::any &  new_Value) [pure virtual]

multiply constant with column

for all indeces i holds the following property: B[i]=A[i]*new_Value

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual bool CoGaDB::ColumnBase::multiply ( ColumnPtr  column) [pure virtual]
virtual const PositionListPairPtr CoGaDB::ColumnBase::nested_loop_join ( ColumnPtr  join_column) [pure virtual]

joins two columns using the nested loop join algorithm

Returns:
PositionListPairPtr to a PositionListPair, which represents the result

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual const PositionListPairPtr CoGaDB::ColumnBase::nested_loop_join ( ColumnPtr  join_column) [pure virtual]

joins two columns using the nested loop join algorithm

Returns:
PositionListPairPtr to a PositionListPair, which represents the result

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual const PositionListPairPtr CoGaDB::ColumnBase::parallel_hash_join ( ColumnPtr  join_column,
unsigned int  number_of_threads 
) [pure virtual]

joins two columns using the hash join algorithm with a parallel pruning phase

Returns:
PositionListPairPtr to a PositionListPair, which represents the result

Implemented in CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual const PositionListPtr CoGaDB::ColumnBase::parallel_selection ( const boost::any &  value_for_comparison,
const ValueComparator  comp,
unsigned int  number_of_threads 
) [pure virtual]

filters the values of a column in parallel according to a filter condition consisting of a comparison value and a ValueComparator (=,<,>)

the additional parameter specifies the number of threads that may be used to perform the operation

Returns:
PositionListPtr to a PositionList, which represents the result

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual const PositionListPtr CoGaDB::ColumnBase::parallel_selection ( const boost::any &  value_for_comparison,
const ValueComparator  comp,
unsigned int  number_of_threads 
) [pure virtual]

filters the values of a column in parallel according to a filter condition consisting of a comparison value and a ValueComparator (=,<,>)

the additional parameter specifies the number of threads that may be used to perform the operation

Returns:
PositionListPtr to a PositionList, which represents the result

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual const PositionListPtr CoGaDB::ColumnBase::selection ( const boost::any &  value_for_comparison,
const ValueComparator  comp 
) [pure virtual]

filters the values of a column according to a filter condition consisting of a comparison value and a ValueComparator (=,<,>)

Returns:
PositionListPtr to a PositionList, which represents the result

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, and CoGaDB::Column< T >.

virtual const PositionListPtr CoGaDB::ColumnBase::selection ( const boost::any &  value_for_comparison,
const ValueComparator  comp 
) [pure virtual]

filters the values of a column according to a filter condition consisting of a comparison value and a ValueComparator (=,<,>)

Returns:
PositionListPtr to a PositionList, which represents the result

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, and CoGaDB::Column< T >.

virtual const PositionListPtr CoGaDB::ColumnBase::selection ( ColumnPtr  ,
const ValueComparator  comp 
) [pure virtual]

filters the values of a column according to a filter condition consisting of a comparison column and a ValueComparator (=,<,>). This implements the comparison of two values from two columns.

Returns:
PositionListPtr to a PositionList, which represents the result

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, and CoGaDB::Column< T >.

void CoGaDB::ColumnBase::setName ( const std::string &  value) throw ()

sets the attribute name of column

virtual const PositionListPtr CoGaDB::ColumnBase::sort ( SortOrder  order = ASCENDING) [pure virtual]

sorts a column w.r.t. a SortOrder

Returns:
PositionListPtr to a PositionList, which represents the result

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual const PositionListPtr CoGaDB::ColumnBase::sort ( SortOrder  order = ASCENDING) [pure virtual]

sorts a column w.r.t. a SortOrder

Returns:
PositionListPtr to a PositionList, which represents the result

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual const PositionListPairPtr CoGaDB::ColumnBase::sort_merge_join ( ColumnPtr  join_column) [pure virtual]

joins two columns using the sort merge join algorithm

Returns:
PositionListPairPtr to a PositionListPair, which represents the result

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual const PositionListPairPtr CoGaDB::ColumnBase::sort_merge_join ( ColumnPtr  join_column) [pure virtual]

joins two columns using the sort merge join algorithm

Returns:
PositionListPairPtr to a PositionListPair, which represents the result

Implemented in CoGaDB::ColumnBaseTyped< T >, CoGaDB::ColumnBaseTyped< std::string >, CoGaDB::ColumnBaseTyped< T >, and CoGaDB::ColumnBaseTyped< std::string >.

virtual const std::type_info& CoGaDB::ColumnBase::type ( ) const throw () [pure virtual]
virtual const std::type_info& CoGaDB::ColumnBase::type ( ) const throw () [pure virtual]

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