The abstract table class. More...
#include <table.h>
Classes | |
class | cursor |
Cursor class for row-wise data accesses. More... | |
struct | row |
A simple struct for storing a row of a table. More... | |
Public Types | |
typedef ibis::array_t< void * > | bufferList |
A list to hold the in-memory buffers. | |
typedef std::map< const char *, ibis::TYPE_T, ibis::lessi > | namesTypes |
An associative array of names and types. | |
typedef ibis::array_t< const char * > | stringList |
A list of strings. | |
typedef ibis::array_t < ibis::TYPE_T > | typeList |
A list of data types. | |
Public Member Functions | |
virtual int | addPartition (const char *) |
Add a data partition defined in the named directory. | |
virtual int | backup (const char *dir, const char *tname=0, const char *tdesc=0) const =0 |
Write the current content to the specified output directory in the raw binary format. | |
virtual stringList | columnNames () const =0 |
Return column names. | |
virtual typeList | columnTypes () const =0 |
Return data types. | |
virtual cursor * | createCursor () const =0 |
Create a cursor object to perform row-wise data access. | |
virtual void | describe (std::ostream &) const =0 |
Print a description of the table to the specified output stream. | |
virtual const char * | description () const |
Free text description. May return a null pointer. | |
virtual int | dump (std::ostream &out, const char *del=", ") const =0 |
Print the values in ASCII form to the specified output stream. | |
virtual int | dump (std::ostream &out, uint64_t nr, const char *del=", ") const =0 |
Print the first nr rows. | |
virtual int | dump (std::ostream &out, uint64_t offset, uint64_t nr, const char *del=", ") const =0 |
Print nr rows starting with row offset. | |
virtual void | dumpNames (std::ostream &out, const char *del=", ") const =0 |
Print all column names on one line. | |
virtual void | estimate (const char *cond, uint64_t &nmin, uint64_t &nmax) const =0 |
Estimate the number of rows satisfying the selection conditions. | |
virtual void | estimate (const ibis::qExpr *cond, uint64_t &nmin, uint64_t &nmax) const =0 |
Estimate the number of rows satisfying the selection conditions. | |
virtual int | getPartitions (ibis::constPartList &) const |
Retrieve the list of partitions. | |
virtual table * | groupby (const stringList &) const =0 |
Perform aggregate functions on the current table. | |
virtual table * | groupby (const char *) const |
Perform a group-by operation. | |
virtual const char * | name () const |
Name of the table. | |
virtual uint32_t | nColumns () const =0 |
The number of columns in this table. | |
virtual uint64_t | nRows () const =0 |
The number of rows in this table. | |
virtual void | orderby (const stringList &)=0 |
Reorder the rows. | |
virtual void | orderby (const stringList &, const std::vector< bool > &)=0 |
virtual void | orderby (const char *) |
Reorder the rows. The column names are separated by commas. | |
virtual void | reverseRows ()=0 |
Reverse the order of the rows. | |
virtual table * | select (const char *sel, const char *cond) const =0 |
Given a set of column names and a set of selection conditions, compute another table that represents the selected values. | |
virtual table * | select (const char *sel, const ibis::qExpr *cond) const |
Process the selection conditions and generate another table to hold the answer. | |
virtual | ~table () |
Destructor. | |
virtual int | buildIndex (const char *colname, const char *option=0)=0 |
The following functions deal with auxillary data for accelerating query processing, primarily for building indexes. | |
virtual int | buildIndexes (const char *options=0)=0 |
Create indexes for every column of the table. | |
virtual const char * | indexSpec (const char *colname=0) const =0 |
Retrieve the current indexing option. | |
virtual void | indexSpec (const char *opt, const char *colname=0)=0 |
Replace the current indexing option. | |
virtual int | combineCategories (const stringList &) |
Combine the categories. | |
virtual int64_t | getColumnAsBytes (const char *cname, char *vals, uint64_t begin=0, uint64_t end=0) const =0 |
Retrieve all values of the named column. | |
virtual int64_t | getColumnAsUBytes (const char *cname, unsigned char *vals, uint64_t begin=0, uint64_t end=0) const =0 |
Retrieve all values of the named column. | |
virtual int64_t | getColumnAsShorts (const char *cname, int16_t *vals, uint64_t begin=0, uint64_t end=0) const =0 |
Retrieve all values of the named column. | |
virtual int64_t | getColumnAsUShorts (const char *cname, uint16_t *vals, uint64_t begin=0, uint64_t end=0) const =0 |
Retrieve all values of the named column. | |
virtual int64_t | getColumnAsInts (const char *cname, int32_t *vals, uint64_t begin=0, uint64_t end=0) const =0 |
Retrieve all values of the named column. | |
virtual int64_t | getColumnAsUInts (const char *cname, uint32_t *vals, uint64_t begin=0, uint64_t end=0) const =0 |
Retrieve all values of the named column. | |
virtual int64_t | getColumnAsLongs (const char *cname, int64_t *vals, uint64_t begin=0, uint64_t end=0) const =0 |
Retrieve all values of the named column. | |
virtual int64_t | getColumnAsULongs (const char *cname, uint64_t *vals, uint64_t begin=0, uint64_t end=0) const =0 |
Retrieve all values of the named column. | |
virtual int64_t | getColumnAsFloats (const char *cname, float *vals, uint64_t begin=0, uint64_t end=0) const =0 |
Retrieve all values of the named column. | |
virtual int64_t | getColumnAsDoubles (const char *cname, double *vals, uint64_t begin=0, uint64_t end=0) const =0 |
Retrieve all values of the named column. | |
virtual int64_t | getColumnAsDoubles (const char *cname, std::vector< double > &vals, uint64_t begin=0, uint64_t end=0) const =0 |
Retrieve all values of the named column. | |
virtual int64_t | getColumnAsStrings (const char *cname, std::vector< std::string > &vals, uint64_t begin=0, uint64_t end=0) const =0 |
Retrieve the null-terminated strings as a vector of std::string objects. | |
virtual double | getColumnMin (const char *cname) const =0 |
Compute the minimum of all valid values in the name column. | |
virtual double | getColumnMax (const char *cname) const =0 |
Compute the maximum of all valid values in the name column. | |
virtual long | getHistogram (const char *constraints, const char *cname, double begin, double end, double stride, std::vector< uint32_t > &counts) const =0 |
virtual long | getHistogram2D (const char *constraints, const char *cname1, double begin1, double end1, double stride1, const char *cname2, double begin2, double end2, double stride2, std::vector< uint32_t > &counts) const =0 |
Compute a two-dimension histogram on columns cname1 and cname2 . | |
virtual long | getHistogram3D (const char *constraints, const char *cname1, double begin1, double end1, double stride1, const char *cname2, double begin2, double end2, double stride2, const char *cname3, double begin3, double end3, double stride3, std::vector< uint32_t > &counts) const =0 |
Compute a three-dimensional histogram on the named columns. | |
Static Public Member Functions | |
static void * | allocateBuffer (ibis::TYPE_T, size_t) |
Allocate a buffer of the specified type and size. | |
static int64_t | computeHits (const ibis::constPartList &parts, const char *cond) |
Compute the number of rows satisfying the specified conditions. | |
static int64_t | computeHits (const ibis::constPartList &parts, const ibis::qExpr *cond) |
Compute the number of rows satisfying the specified query expression. | |
static ibis::table * | create (ibis::part &) |
Create a simple of container of a partition. | |
static ibis::table * | create (const ibis::partList &) |
Create a container of externally managed data partitions. | |
static ibis::table * | create (const char *dir) |
Create a table object from the specified data directory. | |
static ibis::table * | create (const char *dir1, const char *dir2) |
Create a table object from a pair of data directories. | |
static void | freeBuffer (void *buffer, ibis::TYPE_T type) |
Freeing a buffer for storing in-memory values. | |
static void | freeBuffers (bufferList &, typeList &) |
Freeing a list of buffers. | |
static void | parseNames (char *in, stringList &out) |
Parse the incoming string into a set of names. | |
static void | parseOrderby (char *in, stringList &out, std::vector< bool > &direc) |
Parse the incoming string as an order-by clause. | |
static table * | select (const ibis::constPartList &parts, const char *sel, const char *cond) |
Perform the select operation on a list of data partitions. | |
static table * | select (const ibis::constPartList &parts, const char *sel, const ibis::qExpr *cond) |
Perform select operation using a user-supplied query expression. | |
Protected Member Functions | |
table () | |
The default constructor. | |
table (const char *na, const char *de) | |
Constructor. Use the user-supplied name and description. | |
Protected Attributes | |
std::string | desc_ |
Description of the table. | |
std::string | name_ |
Name of the table. |
The abstract table class.
This is an abstract base class that defines the common operations on a data table. Conceptually, data records in a table is organized into rows and columns. A query on a table produces a filtered version of the table. In many database systems this is known as a view of a table. All data tables and views are logically treated as specialization of this class. An example of using this class can be found in examples/thula.cpp.
typedef ibis::array_t<void *> ibis::table::bufferList |
A list to hold the in-memory buffers.
The void* is either ibis::array_t* or std::vector<std::string> depending on the underlying data type. Typically used together with typeList.
typedef ibis::array_t<const char*> ibis::table::stringList |
A list of strings.
virtual int ibis::table::addPartition | ( | const char * | ) | [inline, virtual] |
Add a data partition defined in the named directory.
Upon successful completion, it returns the number of data partitions found, otherwise it returns a negative number to indicate failure.
If the name of the directory is a nil pointer, this function will examine the entries in the configuration parameters to identify locations of data partitions. This matches the behavior of ibis::table::create.
Reimplemented in ibis::liga, and ibis::mensa.
virtual int ibis::table::backup | ( | const char * | dir, |
const char * | tname = 0 , |
||
const char * | tdesc = 0 |
||
) | const [pure virtual] |
Write the current content to the specified output directory in the raw binary format.
May optionally overwrite the name and description of the table.
Implemented in ibis::tabele, ibis::bord, ibis::tabula, and ibis::mensa.
virtual int ibis::table::buildIndex | ( | const char * | colname, |
const char * | option = 0 |
||
) | [pure virtual] |
The following functions deal with auxillary data for accelerating query processing, primarily for building indexes.
Create the index for the named column. The existing index will be replaced. If an indexing option is not specified, it will use the internally recorded option for the named column or the table containing the column.
Implemented in ibis::tabele, ibis::tabula, ibis::mensa, and ibis::bord.
virtual int ibis::table::buildIndexes | ( | const char * | options = 0 | ) | [pure virtual] |
Create indexes for every column of the table.
Existing indexes will be replaced. If an indexing option is not specified, the internally recorded options will be used.
Implemented in ibis::tabele, ibis::tabula, ibis::mensa, and ibis::bord.
virtual int ibis::table::combineCategories | ( | const stringList & | ) | [inline, virtual] |
Combine the categories.
The argument is to be list of column names. If the incoming list is empty, then dictionaries of categorical columns with the same names are combined. If a list is provided by the caller, then all columns with the given names will be placed in a single dictionary. Additionally, all indexes associated with the columns will be updated to make use of the new combined dictionary.
A default implementation is provided. This default implementation does nothing and returns 0. This action is valid for a table with only a single partition and the incoming list is empty.
Reimplemented in ibis::mensa.
int64_t ibis::table::computeHits | ( | const ibis::constPartList & | parts, |
const char * | cond | ||
) | [static] |
Compute the number of rows satisfying the specified conditions.
It iterates through all data partitions to compute the number of hits.
References ibis::countQuery::evaluate(), ibis::countQuery::getNumHits(), ibis::gVerbose, ibis::countQuery::setPartition(), and ibis::countQuery::setWhereClause().
Referenced by select(), ibis::mensa::select2(), ibis::filter::sift(), ibis::filter::sift2(), and ibis::filter::sift2S().
int64_t ibis::table::computeHits | ( | const ibis::constPartList & | parts, |
const ibis::qExpr * | cond | ||
) | [static] |
Compute the number of rows satisfying the specified query expression.
It iterates through all data partitions to compute the number of hits.
References ibis::countQuery::evaluate(), ibis::countQuery::getNumHits(), ibis::gVerbose, ibis::countQuery::setPartition(), and ibis::countQuery::setWhereClause().
ibis::table * ibis::table::create | ( | ibis::part & | p | ) | [static] |
Create a simple of container of a partition.
The objective is to make the functions of this class available. The caller retains the ownership of the data partition.
ibis::table * ibis::table::create | ( | const ibis::partList & | pl | ) | [static] |
Create a container of externally managed data partitions.
The objective is to make the functions of this class available. The caller retains the ownership of the data partition.
ibis::table * ibis::table::create | ( | const char * | dir | ) | [static] |
Create a table object from the specified data directory.
If the incoming directory name is nil or an empty string, it attempts to use the directories specified in the configuration files.
If the argument is a nil pointer, it will examine configuration parameters to find locations of data patitions.
ibis::table * ibis::table::create | ( | const char * | dir1, |
const char * | dir2 | ||
) | [static] |
Create a table object from a pair of data directories.
The intention of maintaining two sets of data files is to process queries using one set while accept new data records with the other. However, such functionality is not currently implemented!
virtual int ibis::table::dump | ( | std::ostream & | out, |
const char * | del = ", " |
||
) | const [pure virtual] |
Print the values in ASCII form to the specified output stream.
The default delimiter is coma (","), which produces Comma-Separated-Values (CSV).
Implemented in ibis::tabele, ibis::bord, ibis::tabula, and ibis::mensa.
virtual int ibis::table::dump | ( | std::ostream & | out, |
uint64_t | offset, | ||
uint64_t | nr, | ||
const char * | del = ", " |
||
) | const [pure virtual] |
Print nr rows starting with row offset.
Note that the row number starts with 0, i.e., the first row is row 0.
Implemented in ibis::tabele, ibis::bord, ibis::tabula, and ibis::mensa.
virtual void ibis::table::estimate | ( | const char * | cond, |
uint64_t & | nmin, | ||
uint64_t & | nmax | ||
) | const [pure virtual] |
Estimate the number of rows satisfying the selection conditions.
The number of rows is between [nmin
, nmax
] (inclusive).
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual void ibis::table::estimate | ( | const ibis::qExpr * | cond, |
uint64_t & | nmin, | ||
uint64_t & | nmax | ||
) | const [pure virtual] |
Estimate the number of rows satisfying the selection conditions.
The number of rows is between [nmin
, nmax
] (inclusive).
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual int64_t ibis::table::getColumnAsBytes | ( | const char * | cname, |
char * | vals, | ||
uint64_t | begin = 0 , |
||
uint64_t | end = 0 |
||
) | const [pure virtual] |
Retrieve all values of the named column.
The member functions of this class only support access to one column at a time. Use table::cursor
class for row-wise accesses.
The arguments begin and end are given in row numbers starting from 0. If begin < end, then rows begin till end-1 are packed into the output array. If begin >= end, then the values from begin till end of the table is packed into the output array. The default values where both begin and end are 0 define a range covering all rows of the table.
Implemented in ibis::tabele, ibis::bord, ibis::tabula, and ibis::mensa.
virtual int64_t ibis::table::getColumnAsDoubles | ( | const char * | cname, |
double * | vals, | ||
uint64_t | begin = 0 , |
||
uint64_t | end = 0 |
||
) | const [pure virtual] |
Retrieve all values of the named column.
The member functions of this class only support access to one column at a time. Use table::cursor
class for row-wise accesses.
The arguments begin and end are given in row numbers starting from 0. If begin < end, then rows begin till end-1 are packed into the output array. If begin >= end, then the values from begin till end of the table is packed into the output array. The default values where both begin and end are 0 define a range covering all rows of the table.
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual int64_t ibis::table::getColumnAsDoubles | ( | const char * | cname, |
std::vector< double > & | vals, | ||
uint64_t | begin = 0 , |
||
uint64_t | end = 0 |
||
) | const [pure virtual] |
Retrieve all values of the named column.
The member functions of this class only support access to one column at a time. Use table::cursor
class for row-wise accesses.
The arguments begin and end are given in row numbers starting from 0. If begin < end, then rows begin till end-1 are packed into the output array. If begin >= end, then the values from begin till end of the table is packed into the output array. The default values where both begin and end are 0 define a range covering all rows of the table.
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual int64_t ibis::table::getColumnAsFloats | ( | const char * | cname, |
float * | vals, | ||
uint64_t | begin = 0 , |
||
uint64_t | end = 0 |
||
) | const [pure virtual] |
Retrieve all values of the named column.
The member functions of this class only support access to one column at a time. Use table::cursor
class for row-wise accesses.
The arguments begin and end are given in row numbers starting from 0. If begin < end, then rows begin till end-1 are packed into the output array. If begin >= end, then the values from begin till end of the table is packed into the output array. The default values where both begin and end are 0 define a range covering all rows of the table.
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual int64_t ibis::table::getColumnAsInts | ( | const char * | cname, |
int32_t * | vals, | ||
uint64_t | begin = 0 , |
||
uint64_t | end = 0 |
||
) | const [pure virtual] |
Retrieve all values of the named column.
The member functions of this class only support access to one column at a time. Use table::cursor
class for row-wise accesses.
The arguments begin and end are given in row numbers starting from 0. If begin < end, then rows begin till end-1 are packed into the output array. If begin >= end, then the values from begin till end of the table is packed into the output array. The default values where both begin and end are 0 define a range covering all rows of the table.
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual int64_t ibis::table::getColumnAsLongs | ( | const char * | cname, |
int64_t * | vals, | ||
uint64_t | begin = 0 , |
||
uint64_t | end = 0 |
||
) | const [pure virtual] |
Retrieve all values of the named column.
The member functions of this class only support access to one column at a time. Use table::cursor
class for row-wise accesses.
The arguments begin and end are given in row numbers starting from 0. If begin < end, then rows begin till end-1 are packed into the output array. If begin >= end, then the values from begin till end of the table is packed into the output array. The default values where both begin and end are 0 define a range covering all rows of the table.
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual int64_t ibis::table::getColumnAsShorts | ( | const char * | cname, |
int16_t * | vals, | ||
uint64_t | begin = 0 , |
||
uint64_t | end = 0 |
||
) | const [pure virtual] |
Retrieve all values of the named column.
The member functions of this class only support access to one column at a time. Use table::cursor
class for row-wise accesses.
The arguments begin and end are given in row numbers starting from 0. If begin < end, then rows begin till end-1 are packed into the output array. If begin >= end, then the values from begin till end of the table is packed into the output array. The default values where both begin and end are 0 define a range covering all rows of the table.
Implemented in ibis::tabele, ibis::bord, ibis::tabula, and ibis::mensa.
virtual int64_t ibis::table::getColumnAsStrings | ( | const char * | cname, |
std::vector< std::string > & | vals, | ||
uint64_t | begin = 0 , |
||
uint64_t | end = 0 |
||
) | const [pure virtual] |
Retrieve the null-terminated strings as a vector of std::string objects.
Both ibis::CATEGORY and ibis::TEXT types can be retrieved using this function.
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual int64_t ibis::table::getColumnAsUBytes | ( | const char * | cname, |
unsigned char * | vals, | ||
uint64_t | begin = 0 , |
||
uint64_t | end = 0 |
||
) | const [pure virtual] |
Retrieve all values of the named column.
The member functions of this class only support access to one column at a time. Use table::cursor
class for row-wise accesses.
The arguments begin and end are given in row numbers starting from 0. If begin < end, then rows begin till end-1 are packed into the output array. If begin >= end, then the values from begin till end of the table is packed into the output array. The default values where both begin and end are 0 define a range covering all rows of the table.
Implemented in ibis::tabele, ibis::bord, ibis::tabula, and ibis::mensa.
virtual int64_t ibis::table::getColumnAsUInts | ( | const char * | cname, |
uint32_t * | vals, | ||
uint64_t | begin = 0 , |
||
uint64_t | end = 0 |
||
) | const [pure virtual] |
Retrieve all values of the named column.
The member functions of this class only support access to one column at a time. Use table::cursor
class for row-wise accesses.
The arguments begin and end are given in row numbers starting from 0. If begin < end, then rows begin till end-1 are packed into the output array. If begin >= end, then the values from begin till end of the table is packed into the output array. The default values where both begin and end are 0 define a range covering all rows of the table.
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual int64_t ibis::table::getColumnAsULongs | ( | const char * | cname, |
uint64_t * | vals, | ||
uint64_t | begin = 0 , |
||
uint64_t | end = 0 |
||
) | const [pure virtual] |
Retrieve all values of the named column.
The member functions of this class only support access to one column at a time. Use table::cursor
class for row-wise accesses.
The arguments begin and end are given in row numbers starting from 0. If begin < end, then rows begin till end-1 are packed into the output array. If begin >= end, then the values from begin till end of the table is packed into the output array. The default values where both begin and end are 0 define a range covering all rows of the table.
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual int64_t ibis::table::getColumnAsUShorts | ( | const char * | cname, |
uint16_t * | vals, | ||
uint64_t | begin = 0 , |
||
uint64_t | end = 0 |
||
) | const [pure virtual] |
Retrieve all values of the named column.
The member functions of this class only support access to one column at a time. Use table::cursor
class for row-wise accesses.
The arguments begin and end are given in row numbers starting from 0. If begin < end, then rows begin till end-1 are packed into the output array. If begin >= end, then the values from begin till end of the table is packed into the output array. The default values where both begin and end are 0 define a range covering all rows of the table.
Implemented in ibis::tabele, ibis::bord, ibis::tabula, and ibis::mensa.
virtual double ibis::table::getColumnMax | ( | const char * | cname | ) | const [pure virtual] |
Compute the maximum of all valid values in the name column.
In case of error, such as an invalid column name or an empty table, this function will return FASTBIT_DOUBLE_NULL or -DBL_MAX to ensure that the following test fails getColumnMin <= getColumnMax.
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual double ibis::table::getColumnMin | ( | const char * | cname | ) | const [pure virtual] |
Compute the minimum of all valid values in the name column.
In case of error, such as an invalid column name or an empty table, this function will return FASTBIT_DOUBLE_NULL or DBL_MAX to ensure that the following test fails getColumnMin <= getColumnMax.
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual long ibis::table::getHistogram | ( | const char * | constraints, |
const char * | cname, | ||
double | begin, | ||
double | end, | ||
double | stride, | ||
std::vector< uint32_t > & | counts | ||
) | const [pure virtual] |
Compute the histogram of the named column. This version uses the user specified bins:
[begin, begin+stride) [begin+stride, begin+2*stride) ....
A record is placed in bin
(x - begin) / stride,
where the first bin is bin 0. The total number of bins is
1 + floor((end - begin) / stride).
stride
is considered as an error. end
is less than begin
, an empty array counts
is returned along with return value 0. Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual long ibis::table::getHistogram2D | ( | const char * | constraints, |
const char * | cname1, | ||
double | begin1, | ||
double | end1, | ||
double | stride1, | ||
const char * | cname2, | ||
double | begin2, | ||
double | end2, | ||
double | stride2, | ||
std::vector< uint32_t > & | counts | ||
) | const [pure virtual] |
Compute a two-dimension histogram on columns cname1
and cname2
.
The bins along each dimension are defined the same way as in function getHistogram
. The array counts
stores the two-dimensional bins with the first dimension as the slow varying dimension following C convention for ordering multi-dimensional arrays.
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual long ibis::table::getHistogram3D | ( | const char * | constraints, |
const char * | cname1, | ||
double | begin1, | ||
double | end1, | ||
double | stride1, | ||
const char * | cname2, | ||
double | begin2, | ||
double | end2, | ||
double | stride2, | ||
const char * | cname3, | ||
double | begin3, | ||
double | end3, | ||
double | stride3, | ||
std::vector< uint32_t > & | counts | ||
) | const [pure virtual] |
Compute a three-dimensional histogram on the named columns.
The triplets <begin, end, stride> are used the same ways in getHistogram
and getHistogram2D
. The three dimensional bins are linearized in counts
with the first being the slowest varying dimension and the third being the fastest varying dimension following the C convention for ordering multi-dimensional arrays.
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
virtual table* ibis::table::groupby | ( | const stringList & | ) | const [pure virtual] |
Perform aggregate functions on the current table.
It produces a new table. The list of strings passed to this function are interpreted as a set of names followed by a set of functions. Currently, only functions COUNT, AVG, MIN, MAX, SUM, VARPOP, VARSAMP, STDPOP, STDSAMP and DISTINCT are supported, and the functions can only accept a column name as arguments.
Implemented in ibis::tabele, ibis::tabula, ibis::mensa, and ibis::bord.
ibis::table * ibis::table::groupby | ( | const char * | str | ) | const [virtual] |
Perform a group-by operation.
The column names and operations are separated by commas.
Reimplemented in ibis::tabele, ibis::tabula, ibis::mensa, and ibis::bord.
virtual const char* ibis::table::indexSpec | ( | const char * | colname = 0 | ) | const [pure virtual] |
Retrieve the current indexing option.
If no column name is specified, it retrieve the indexing option for the table.
Implemented in ibis::tabele, ibis::tabula, ibis::mensa, and ibis::bord.
virtual void ibis::table::indexSpec | ( | const char * | opt, |
const char * | colname = 0 |
||
) | [pure virtual] |
Replace the current indexing option.
If no column name is specified, it resets the indexing option for the table.
Implemented in ibis::tabele, ibis::tabula, ibis::mensa, and ibis::bord.
virtual const char* ibis::table::name | ( | ) | const [inline, virtual] |
Name of the table.
A valid table shall not return a null pointer nor an empty string.
Referenced by ibis::tableList::add(), and ibis::mensa::cursor::cursor().
virtual void ibis::table::orderby | ( | const stringList & | ) | [pure virtual] |
Reorder the rows.
Sort the rows in ascending order of the columns specified in the list of column names. This function is not designated const
even though it does not change the content in SQL logic, but it may change internal representations.
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
void ibis::table::parseNames | ( | char * | in, |
stringList & | out | ||
) | [static] |
Parse the incoming string into a set of names.
Some bytes in the incoming string may be turned into nil (0) to mark the end of names or functions. Newly discovered tokens will be appended to out.
References ibis::gVerbose, and ibis::array_t< T >::push_back().
void ibis::table::parseOrderby | ( | char * | in, |
stringList & | out, | ||
std::vector< bool > & | direc | ||
) | [static] |
Parse the incoming string as an order-by clause.
An order-by clause is a list of column names where each name is optionally followed by a keyword ASC or DESC. The corresponding element of direc is set true for ASC and false for DESC. The unspecified elements are assumed to be ASC per SQL convention.
References ibis::gVerbose, and ibis::array_t< T >::push_back().
virtual table* ibis::table::select | ( | const char * | sel, |
const char * | cond | ||
) | const [pure virtual] |
Given a set of column names and a set of selection conditions, compute another table that represents the selected values.
Implemented in ibis::tabele, ibis::tabula, ibis::bord, and ibis::mensa.
Referenced by ibis::mensa::select(), ibis::bord::select(), select(), and ibis::mensa::select2().
ibis::table * ibis::table::select | ( | const char * | sel, |
const ibis::qExpr * | cond | ||
) | const [virtual] |
Process the selection conditions and generate another table to hold the answer.
This implementation of the member function uses the class function ibis::table::select that takes the similar arguments along with the full list of data partitions to work with.
This function returns a nil table when the select clause is empty or nil.
References ibis::gVerbose, ibis::fileManager::instance(), ibis::fileManager::printStatus(), and select().
ibis::table * ibis::table::select | ( | const ibis::constPartList & | mylist, |
const char * | sel, | ||
const char * | cond | ||
) | [static] |
Perform the select operation on a list of data partitions.
Upon successful completion of this function, it produces an in-memory data partition holding the selected data records.
It will fail in a unpredictable way if the selected records can not fit in the available memory.
If the select clause is missing, the return table will have no columns and the number of rows is the number of rows satisfying the query conditions. An empty query condition matches all rows following the SQL convension.
References computeHits(), ibis::selectClause::empty(), ibis::gVerbose, ibis::fileManager::instance(), ibis::fileManager::printStatus(), ibis::filter::sift(), and ibis::filter::sift0().
ibis::table * ibis::table::select | ( | const ibis::constPartList & | plist, |
const char * | sel, | ||
const ibis::qExpr * | cond | ||
) | [static] |
Perform select operation using a user-supplied query expression.
Upon successful completion of this function, it produces an in-memory data partition holding the selected data records.
It will fail in an unpredictable way if the selected records can not fit in available memory.
If the select clause is missing, the return table will have no columns and the number of rows is the number of rows satisfying the query conditions. An empty query condition matches all rows following the SQL convension.
References computeHits(), ibis::selectClause::empty(), ibis::gVerbose, ibis::fileManager::instance(), ibis::fileManager::printStatus(), ibis::whereClause::setExpr(), ibis::filter::sift(), and ibis::filter::sift0().
![]() |