In-memory Range Join. More...
#include <jrange.h>
Public Member Functions | |
virtual int64_t | count () const |
Compute the number of results. More... | |
template<typename T > | |
ibis::table * | fillResult (size_t nrows, double delta1, double delta2, const std::string &desc, const ibis::array_t< T > &rjcol, const ibis::table::typeArray &rtypes, const ibis::table::bufferArray &rbuff, const ibis::array_t< T > &sjcol, const ibis::table::typeArray &stypes, const ibis::table::bufferArray &sbuff, const ibis::table::stringArray &tcname, const std::vector< uint32_t > &tcnpos) |
Generate a table representing a range-join in memory. More... | |
jRange (const ibis::part &partr, const ibis::part &parts, const ibis::column &colr, const ibis::column &cols, double delta1, double delta2, const ibis::qExpr *condr, const ibis::qExpr *conds, const ibis::selectClause *sel, const ibis::fromClause *frm, const char *desc) | |
Constructor. | |
virtual void | roughCount (uint64_t &nmin, uint64_t &nmax) const |
Estimate the number of hits. Nothing useful at this time. | |
virtual ibis::table * | select () const |
Produce a projection of the joint table. More... | |
virtual ibis::table * | select (const char *) const |
Produce a project based on the given select clause. More... | |
virtual ibis::table * | select (const ibis::table::stringArray &colnames) const |
Produce a projection of all known data partitions. More... | |
virtual | ~jRange () |
Destructor. | |
Static Protected Member Functions | |
template<typename T > | |
static table * | fillResult (size_t nrows, double delta1, double delta2, const std::string &desc, const ibis::array_t< T > &rjcol, const ibis::table::typeArray &rtypes, const ibis::table::bufferArray &rbuff, const ibis::array_t< T > &sjcol, const ibis::table::typeArray &stypes, const ibis::table::bufferArray &sbuff, const ibis::table::stringArray &cnamet, const std::vector< uint32_t > &cnpos) |
Protected Attributes | |
const ibis::column & | colr_ |
const ibis::column & | cols_ |
const double | delta1_ |
const double | delta2_ |
std::string | desc_ |
const ibis::fromClause * | frm_ |
ibis::bitvector | maskr_ |
ibis::bitvector | masks_ |
int64_t | nrows |
array_t< uint32_t > * | orderr_ |
array_t< uint32_t > * | orders_ |
const ibis::part & | partr_ |
const ibis::part & | parts_ |
const ibis::selectClause * | sel_ |
void * | valr_ |
void * | vals_ |
Additional Inherited Members | |
Static Public Member Functions inherited from ibis::quaere | |
static quaere * | create (const char *sel, const char *from, const char *where) |
Create a query object using the global datasets. | |
static quaere * | create (const char *sel, const char *from, const char *where, const ibis::partList &prts) |
Generate a query expression. More... | |
static quaere * | create (const ibis::part *partr, const ibis::part *parts, const char *colname, const char *condr=0, const char *conds=0, const char *sel=0) |
Specify a natural join operation. More... | |
Protected Member Functions inherited from ibis::quaere | |
quaere () | |
Default constructor. Only used by derived classes. | |
In-memory Range Join.
A range join is a SQL query of the form
or
where delta1 and delta2 are constants.
|
virtual |
Compute the number of results.
This function provides the exact answer. If it fails to do so, it will return a negative number to indicate error.
Implements ibis::quaere.
References ibis::DOUBLE, ibis::FLOAT, ibis::INT, ibis::LONG, ibis::SHORT, ibis::util::sortMerge(), ibis::UBYTE, ibis::UINT, ibis::ULONG, and ibis::USHORT.
ibis::table* ibis::jRange::fillResult | ( | size_t | nrows, |
double | delta1, | ||
double | delta2, | ||
const std::string & | desc, | ||
const ibis::array_t< T > & | rjcol, | ||
const ibis::table::typeArray & | rtypes, | ||
const ibis::table::bufferArray & | rbuff, | ||
const ibis::array_t< T > & | sjcol, | ||
const ibis::table::typeArray & | stypes, | ||
const ibis::table::bufferArray & | sbuff, | ||
const ibis::table::stringArray & | tcname, | ||
const std::vector< uint32_t > & | tcnpos | ||
) |
Generate a table representing a range-join in memory.
The input to this function are values to go into the resulting table; it only needs to match the rows and fill the output table.
References ibis::table::allocateBuffer(), ibis::bord::copyValue(), ibis::table::freeBuffers(), ibis::util::ref(), ibis::util::shortName(), ibis::array_t< T >::size(), and ibis::UNKNOWN_TYPE.
|
virtual |
Produce a projection of the joint table.
The select clause associated with the query object is evaluated. If no select clause is provided, it returns a table with no columns. This is different from having a 'count(*)' as the select clause, which produce a table with one row and one column.
Implements ibis::quaere.
References ibis::table::describe(), ibis::table::nColumns(), ibis::table::nRows(), ibis::array_t< T >::push_back(), ibis::math::barrel::recordVariable(), ibis::array_t< T >::reserve(), and ibis::util::shortName().
|
virtual |
Produce a project based on the given select clause.
The joint data table is defined by the where clause and the from clause given to the constructor of this object.
Implements ibis::quaere.
References ibis::selectClause::aggExpr(), ibis::selectClause::aggSize(), ibis::table::describe(), ibis::selectClause::getAggregator(), ibis::table::nColumns(), ibis::table::nRows(), ibis::array_t< T >::push_back(), ibis::math::barrel::recordVariable(), ibis::array_t< T >::reserve(), and ibis::util::shortName().
|
virtual |
Produce a projection of all known data partitions.
This function selects all values of the named columns that are not NULL.
fill the in-memory buffer
Implements ibis::quaere.
References ibis::CATEGORY, ibis::DOUBLE, ibis::FLOAT, ibis::table::freeBuffers(), ibis::category::getDictionary(), ibis::bord::column::getDictionary(), ibis::INT, ibis::LONG, ibis::util::ref(), ibis::util::reorder(), ibis::bord::column::setDictionary(), ibis::SHORT, ibis::util::shortName(), ibis::array_t< T >::size(), ibis::TEXT, ibis::column::type(), ibis::TYPESTRING, ibis::UBYTE, ibis::UINT, ibis::ULONG, ibis::UNKNOWN_TYPE, and ibis::USHORT.