Public Member Functions | Static Public Member Functions | List of all members
ibis::join Class Referenceabstract

An abstract join interface. More...

#include <join.h>

Inheritance diagram for ibis::join:
ibis::joinIN

Public Member Functions

virtual void estimate (uint64_t &nmin, uint64_t &nmax)=0
 Provide an estimate of the number of results. More...
 
virtual int64_t evaluate ()=0
 Compute the number of results. More...
 
virtual tableselect (const std::vector< const char * > &colnames)=0
 Produce a projection of the joined table. More...
 

Static Public Member Functions

static joincreate (const ibis::part &partr, const ibis::part &parts, const char *colname, const char *condr=0, const char *conds=0)
 The natural join. More...
 
template<typename T >
static tablefillEquiJoinTable (size_t nrows, const std::string &desc, const ibis::array_t< T > &rjcol, const ibis::table::typeArray &rtypes, const std::vector< void * > &rbuff, const ibis::array_t< T > &sjcol, const ibis::table::typeArray &stypes, const std::vector< void * > &sbuff, const ibis::table::stringArray &cnamet, const std::vector< uint32_t > &cnpos)
 
static tablefillEquiJoinTable (size_t nrows, const std::string &desc, const std::vector< std::string > &rjcol, const ibis::table::typeArray &rtypes, const std::vector< void * > &rbuff, const std::vector< std::string > &sjcol, const ibis::table::typeArray &stypes, const std::vector< void * > &sbuff, const ibis::table::stringArray &cnamet, const std::vector< uint32_t > &cnpos)
 

Detailed Description

An abstract join interface.

It provides three key functions, specify a join, evaluate the number of hits, and iterate through the results. The task of specifying a join is done with various versions of function create. There are two functions to compute the number of results, estimate and evaluate. The iterator for the result of a join is encapsulated in the class ibis::join::result.

Warning
This is an experimental feature of FastBit. The current design is very limited and is likely to go through major revisions soon. Feel free to express your opinions at fastb.nosp@m.it-u.nosp@m.sers@.nosp@m.hpcr.nosp@m.dm.lb.nosp@m.l.go.nosp@m.v.

Member Function Documentation

ibis::join * ibis::join::create ( const ibis::part partr,
const ibis::part parts,
const char *  colname,
const char *  condr = 0,
const char *  conds = 0 
)
static

The natural join.

This is equivalent to SQL statement

"From partr Join parts Using(colname) Where condr And conds"

Note that conditions specified in condr is for partr only, and conds is for parts only. If no conditions are specified, all valid records in the partition will participate in the natural join.

virtual void ibis::join::estimate ( uint64_t &  nmin,
uint64_t &  nmax 
)
pure virtual

Provide an estimate of the number of results.

It never fails. In the worst case, it will simply set the minimum (nmin) to 0 and the maximum (nmax) to the maximum possible number of results.

Implemented in ibis::joinIN.

virtual int64_t ibis::join::evaluate ( )
pure virtual

Compute the number of results.

This function provide the exact answer. If it fails to do so, it will return a negative number to indicate error.

Implemented in ibis::joinIN.

virtual table* ibis::join::select ( const std::vector< const char * > &  colnames)
pure virtual

Produce a projection of the joined table.

The column names specified should be of the form "part-name.column-name". If a dot ('.') is not present or the string before the dot is not the name of one of the two partitions, the whole string is taken to be a column name. In which case, we first look in partition partr for the named column, then in partition parts. A nil pointer will be returned if some names can not be found in the two partitions.

Implemented in ibis::joinIN.


The documentation for this class was generated from the following files:

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive