Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
ibis::filter Class Reference

A simple filtering query. More...

#include <filter.h>

Inheritance diagram for ibis::filter:
ibis::quaere

List of all members.

Public Member Functions

virtual int64_t count () const
 Compute the number of results.
 filter (const ibis::whereClause *w)
 Constructor.
 filter (const ibis::selectClause *s, const ibis::partList *p, const ibis::whereClause *w)
 Constructor.
virtual void roughCount (uint64_t &nmin, uint64_t &nmax) const
 Provide an estimate of the number of hits.
virtual tableselect (const ibis::table::stringList &colnames) const
 Produce a projection of the joined table.
virtual tableselect () const
 Produce a projection of the joined table.
virtual ~filter ()
 Destructor.

Static Public Member Functions

static tablefilt (const ibis::selectClause &sel, const ibis::partList &pl, const ibis::whereClause &wc)
 Select the rows satisfying the where clause and store the results in a table object.

Protected Member Functions

 filter ()
 Default constructor.

Protected Attributes

const ibis::partListparts_
 A list of data partitions to query.
const ibis::selectClausesel_
 The select clause.
const ibis::whereClausewc_
 The where clause.

Detailed Description

A simple filtering query.

The where clause does not contain any table names. Following the convention used in older version of the query class, the same where clause is applied to all known data partitions.


Constructor & Destructor Documentation

ibis::filter::filter ( const ibis::whereClause w) [explicit]

Constructor.

The incoming where clause is applied to all known data partitions in ibis::datasets.

ibis::filter::filter ( const ibis::selectClause s,
const ibis::partList p,
const ibis::whereClause w 
)

Constructor.

The user supplies all three clauses of a SQL select statement.

The objects are copied if they are not empty.

Note:
This constructor makes a copy of the container for the data partitions, but not the data partitions themselves. In the destructor, only the container is freed, not the data partitions.
ibis::filter::filter ( ) [inline, protected]

Default constructor.

Nothing can be done without explicitly accessing the member variables.


Member Function Documentation

int64_t ibis::filter::count ( ) const [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::datasets, ibis::countQuery::evaluate(), ibis::countQuery::getNumHits(), ibis::countQuery::getWhereClause(), ibis::gVerbose, ibis::countQuery::setPartition(), ibis::countQuery::setSelectClause(), and ibis::countQuery::setWhereClause().

ibis::table * ibis::filter::filt ( const ibis::selectClause tms,
const ibis::partList plist,
const ibis::whereClause cond 
) [static]

Select the rows satisfying the where clause and store the results in a table object.

It concatenates the results from different data partitions in the order of the data partitions given in mylist.

It expects all three arguments to be valid and non-trivial. It will return a nil pointer if those arguments are nil pointers or empty.

References ibis::selectClause::aggSize(), ibis::bitvector::cnt(), ibis::whereClause::empty(), ibis::selectClause::empty(), ibis::countQuery::evaluate(), ibis::whereClause::getExpr(), ibis::countQuery::getHitVector(), ibis::countQuery::getWhereClause(), ibis::gVerbose, ibis::selectClause::numGroupbyKeys(), ibis::countQuery::setPartition(), ibis::countQuery::setSelectClause(), ibis::countQuery::setWhereClause(), ibis::util::shortName(), ibis::selectClause::termName(), and ibis::selectClause::verify().

Referenced by select().

void ibis::filter::roughCount ( uint64_t &  nmin,
uint64_t &  nmax 
) const [virtual]

Provide an estimate of the number of hits.

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.

Implements ibis::quaere.

References ibis::datasets, ibis::countQuery::estimate(), ibis::countQuery::getMaxNumHits(), ibis::countQuery::getMinNumHits(), ibis::gVerbose, ibis::countQuery::setPartition(), ibis::countQuery::setSelectClause(), and ibis::countQuery::setWhereClause().

ibis::table * ibis::filter::select ( const ibis::table::stringList colnames) const [virtual]

Produce a projection of the joined table.

This function selects values using the column names provided instead of the select clause specified when the query is constructed. Note that if more than one data partition was used in specifying the query, the column names should be fully qualified in the form of "part-name.column-name". If a dot ('.') is not present or the string before the dot is not the name of a data partition, the whole string is taken to be a column name. In which case, the lookup proceeds from the list of data partitions one at a time. A nil pointer will be returned if any name is not associated with a known column.

Implements ibis::quaere.

References ibis::selectClause::empty(), filt(), ibis::gVerbose, ibis::fileManager::instance(), and ibis::fileManager::printStatus().


Member Data Documentation

The select clause.

Also used to spply aliases. If the function select is called with an empty select clause, then this variable will be used as the substitute.


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