The bundle with multiple components. More...
#include <bundle.h>
Public Member Functions | |
bundles (const ibis::query &, int=0) | |
Constructor. More... | |
bundles (const ibis::query &, const ibis::bitvector &, int=0) | |
Constructor. More... | |
bundles (const ibis::part &, const ibis::selectClause &, int=0) | |
Constructor. It creates a bundle from all rows of tbl. | |
virtual void * | columnArray (uint32_t j) const |
Return the pointer to the underlying array used to store the jth column of the bundle. More... | |
virtual const ibis::column * | columnPointer (uint32_t j) const |
Column pointer. | |
virtual ibis::TYPE_T | columnType (uint32_t j) const |
Return the type used to store the values of the jth column of the bundle. More... | |
virtual double | getDouble (uint32_t, uint32_t) const |
Retrieve the value of i-th row j-th column as a 64-bit floating-point number. More... | |
virtual float | getFloat (uint32_t, uint32_t) const |
Retrieve the value of i-th row j-th column as a 32-bit floating-point number. More... | |
virtual int32_t | getInt (uint32_t, uint32_t) const |
Retrieve the value of i-th row j-th column as a 32-bit integer. More... | |
virtual int64_t | getLong (uint32_t, uint32_t) const |
Retrieve the value of i-th row j-th column as a 64-bit integer. More... | |
virtual std::string | getString (uint32_t, uint32_t) const |
Retrieve the value of i-th row j-th column as a string. More... | |
virtual uint32_t | getUInt (uint32_t, uint32_t) const |
Retrieve the value of i-th row j-th column as a 32-bit unsigned integer. More... | |
virtual uint64_t | getULong (uint32_t, uint32_t) const |
Retrieve the value of i-th row j-th column as a 64-bit unsigned integer. More... | |
virtual void | print (std::ostream &out) const |
Print out the bundles without RIDs. | |
virtual void | printAll (std::ostream &out) const |
Print out the bundles with RIDs. | |
virtual void | printColumnNames (std::ostream &out) const |
Print column names. | |
virtual void | reorder (const char *) |
Reorder the bundles according to the keys (names) given. More... | |
virtual uint32_t | size () const |
Return the number of bundles. | |
virtual long | truncate (uint32_t keep) |
This single-arugment version of the function truncate keeps the first few rows. More... | |
virtual long | truncate (uint32_t keep, uint32_t start) |
This two-argument version of the function keeps a few rows after a specified starting point. More... | |
virtual long | truncate (const char *names, uint32_t keep) |
Reorder the bundles according to the keys (names) given. More... | |
virtual uint32_t | width () const |
Return the width of the bundles. | |
virtual void | write (const ibis::query &) const |
Write the bundle to the directory for the query q . | |
Public Member Functions inherited from ibis::bundle | |
const ibis::RIDSet * | getRIDs (uint32_t ind) const |
Return the RIDs of the ind th bundle. | |
const ibis::RIDSet * | getRIDs () const |
Return the pointer to all RIDs. | |
const ibis::array_t< uint32_t > * | getStarts () const |
Return the pointer to array starts. | |
uint32_t | numRowsInBundle (uint32_t ind) const |
Compute the number of rows in bundle ind . | |
uint32_t | rowCounts (array_t< uint32_t > &cnt) const |
Compute the number of rows in each group(bundle). More... | |
void | sortRIDs (uint32_t i, uint32_t j) |
Sort RIDs in the range of [i, j) | |
void | swapRIDs (uint32_t i, uint32_t j) |
Additional Inherited Members | |
Static Public Member Functions inherited from ibis::bundle | |
static bundle * | create (const ibis::query &, int=0) |
Create new bundle from a query object. More... | |
static bundle * | create (const ibis::query &, const ibis::bitvector &, int=0) |
Create a new bundle from previously stored information. | |
static bundle * | create (const ibis::part &, const ibis::selectClause &, int=0) |
Create a bundle using the all values of the partition. | |
static const ibis::RIDSet * | readRIDs (const char *dir, const uint32_t i) |
Return the RIDs related to the ith bundle. More... | |
Protected Member Functions inherited from ibis::bundle | |
bundle (const ibis::selectClause &c) | |
bundle (const ibis::query &q) | |
bundle (const ibis::query &q, const ibis::bitvector &hits) | |
bundle (const ibis::part &t, const ibis::selectClause &s) | |
Protected Attributes inherited from ibis::bundle | |
const ibis::selectClause & | comps |
const char * | id |
bool | infile |
ibis::RIDSet * | rids |
array_t< uint32_t > * | starts |
The bundle with multiple components.
|
explicit |
Constructor.
It will use the hit vector of the query to generate a new bundle, if it is not able to read the existing bundles.
References ibis::selectClause::aggExpr(), ibis::selectClause::aggName(), ibis::selectClause::aggSize(), bundles(), ibis::fileManager::storage::bytes(), ibis::bitvector::cnt(), ibis::colValues::create(), ibis::query::dir(), ibis::column::elementSize(), ibis::selectClause::getAggregator(), ibis::part::getColumn(), ibis::fileManager::getFile(), ibis::util::getFileSize(), ibis::query::getHitVector(), ibis::query::getNumHits(), ibis::query::id(), ibis::fileManager::instance(), ibis::part::name(), ibis::query::partition(), print(), printAll(), ibis::query::readRIDs(), ibis::array_t< T >::size(), and size().
Referenced by bundles().
ibis::bundles::bundles | ( | const ibis::query & | q, |
const ibis::bitvector & | hits, | ||
int | dir = 0 |
||
) |
Constructor.
It creates a bundle using the hits provided by the caller (instead of from the query object q).
References ibis::selectClause::aggExpr(), ibis::selectClause::aggName(), ibis::selectClause::aggSize(), bundles(), ibis::bitvector::cnt(), ibis::colValues::create(), ibis::selectClause::getAggregator(), ibis::part::getColumn(), ibis::query::id(), ibis::part::name(), ibis::query::partition(), print(), printAll(), ibis::array_t< T >::size(), and size().
|
inlinevirtual |
Return the pointer to the underlying array used to store the jth column of the bundle.
Reimplemented from ibis::bundle.
|
inlinevirtual |
Return the type used to store the values of the jth column of the bundle.
Reimplemented from ibis::bundle.
References ibis::UNKNOWN_TYPE.
|
virtual |
Retrieve the value of i-th row j-th column as a 64-bit floating-point number.
Return the maximal value defined in the class numeric_limits if indices i and j are out of bounds.
Reimplemented from ibis::bundle.
|
virtual |
Retrieve the value of i-th row j-th column as a 32-bit floating-point number.
Return the maximal value defined in the class numeric_limits if indices i and j are out of bounds.
Reimplemented from ibis::bundle.
|
virtual |
Retrieve the value of i-th row j-th column as a 32-bit integer.
Return the maximal value defined in the class numeric_limits if indices i and j are out of bounds.
Reimplemented from ibis::bundle.
|
virtual |
Retrieve the value of i-th row j-th column as a 64-bit integer.
Return the maximal value defined in the class numeric_limits if indices i and j are out of bounds.
Reimplemented from ibis::bundle.
|
virtual |
Retrieve the value of i-th row j-th column as a string.
Convert the value to its string representation through std::ostringstream
.
Reimplemented from ibis::bundle.
|
virtual |
Retrieve the value of i-th row j-th column as a 32-bit unsigned integer.
Return the maximal value defined in the class numeric_limits if indices i and j are out of bounds.
Reimplemented from ibis::bundle.
|
virtual |
Retrieve the value of i-th row j-th column as a 64-bit unsigned integer.
Return the maximal value defined in the class numeric_limits if indices i and j are out of bounds.
Reimplemented from ibis::bundle.
|
virtual |
Reorder the bundles according to the keys (names) given.
If the argument direction is a negative number, the rows are reversed after sorting. Even if no sorting is done, the reversal of rows is still performed.
turn counts back into starting positions (starts)
Implements ibis::bundle.
References ibis::array_t< T >::find(), ibis::array_t< T >::push_back(), ibis::util::reorder(), ibis::array_t< T >::reserve(), ibis::nameList::select(), ibis::array_t< T >::size(), ibis::array_t< T >::sort(), ibis::array_t< T >::swap(), and ibis::TYPESTRING.
|
virtual |
This single-arugment version of the function truncate keeps the first few rows.
Implements ibis::bundle.
|
virtual |
This two-argument version of the function keeps a few rows after a specified starting point.
Implements ibis::bundle.
|
virtual |
Reorder the bundles according to the keys (names) given.
Keep only the first keep
elements. If direction
< 0, keep the largest ones, otherwise keep the smallest ones.
turn counts back into starting positions (starts)
Implements ibis::bundle.
References ibis::array_t< T >::bottomk(), ibis::array_t< T >::find(), ibis::array_t< T >::push_back(), ibis::util::reorder(), ibis::array_t< T >::reserve(), ibis::nameList::select(), ibis::array_t< T >::size(), ibis::array_t< T >::sort(), ibis::array_t< T >::swap(), and ibis::TYPESTRING.