filter.h
Go to the documentation of this file.
1 // File: $Id$
2 // Author: John Wu <John.Wu at ACM.org>
3 // Copyright (c) 2010-2016 the Regents of the University of California
4 #ifndef IBIS_FILTER_H
5 #define IBIS_FILTER_H
6 
14 #include "quaere.h" // ibis::quaere
15 #include "whereClause.h" // ibis::whereClause
16 #include "selectClause.h" // ibis::selectClause
17 
18 namespace ibis {
19  class filter; // forward definition
20 } // namespace ibis
21 
25 class ibis::filter : public ibis::quaere {
26 public:
27  explicit filter(const ibis::whereClause *);
28  filter(const ibis::selectClause *, const ibis::constPartList *,
29  const ibis::whereClause *);
30  filter(const ibis::bitvector &, const ibis::part &);
31  virtual ~filter();
32 
33  virtual void roughCount(uint64_t& nmin, uint64_t& nmax) const;
34  virtual int64_t count() const;
35  virtual table* select() const;
36  virtual table* select(const char*) const;
37  virtual table* select(const ibis::table::stringArray& colnames) const;
38 
39  static table* sift(const ibis::selectClause &sel,
40  const ibis::constPartList &pl,
41  const ibis::whereClause &wc);
42  static table* sift0(const ibis::selectClause &,
43  const ibis::constPartList &);
44  static table* sift0S(const ibis::selectClause &,
45  const ibis::constPartList &);
46  static table* sift1(const ibis::selectClause &,
47  const ibis::constPartList &,
48  const ibis::whereClause &);
49  static table* sift1S(const ibis::selectClause &,
50  const ibis::constPartList &,
51  const ibis::whereClause &);
52  static table* sift2(const ibis::selectClause &,
53  const ibis::constPartList &,
54  const ibis::whereClause &);
55  static table* sift2(const ibis::selectClause &,
56  const ibis::constPartList &,
58  static table* sift2(const ibis::selectClause &,
59  const ibis::constPartList &,
60  const ibis::whereClause &,
62  static table* sift2S(const ibis::selectClause &,
63  const ibis::constPartList &,
64  const ibis::whereClause &);
65  static table* sift2S(const ibis::selectClause &,
66  const ibis::constPartList &,
68  static table* sift2S(const ibis::selectClause &,
69  const ibis::constPartList &,
70  const ibis::whereClause &,
72 
73 protected:
77  const ibis::constPartList *parts_;
87 
90  filter() : wc_(0), parts_(0), sel_(0) {}
91 
92 private:
93  filter(const filter&); // no copying
94  filter& operator=(const filter&); // no assignment
95 }; // class ibis::filter
96 #endif
A simple filtering query.
Definition: filter.h:25
virtual ~filter()
Destructor.
Definition: filter.cpp:64
A representation of the where clause.
Definition: whereClause.h:161
static table * sift1S(const ibis::selectClause &, const ibis::constPartList &, const ibis::whereClause &)
Perform the filter operation involving one column only.
Definition: filter.cpp:1119
static table * sift0S(const ibis::selectClause &, const ibis::constPartList &)
Select all rows from each data partition and place them in a table object.
Definition: filter.cpp:739
array_t< ibis::bitvector * > hits_
Solution in bitvector form.
Definition: filter.h:84
A class to represent the select clause.
Definition: selectClause.h:112
The current implementation of FastBit is code named IBIS; most data structures and functions are in t...
Definition: bord.h:16
FastBit Quaere Interface.
virtual void roughCount(uint64_t &nmin, uint64_t &nmax) const
Produce a rough count of the number of hits.
Definition: filter.cpp:75
const ibis::whereClause * wc_
The where clause.
Definition: filter.h:75
The abstract table class.
Definition: table.h:77
The class ibis::part represents a partition of a relational table.
Definition: part.h:27
array_t< ibis::bitvector * > cand_
Candidate query results.
Definition: filter.h:86
filter()
Default constructor.
Definition: filter.h:90
Declares ibis::selectClause class.
An abstract query interface.
Definition: quaere.h:35
static table * sift2S(const ibis::selectClause &, const ibis::constPartList &, const ibis::whereClause &)
Select the rows satisfying the where clause and store the results in a table object.
Definition: filter.cpp:1877
static table * sift2(const ibis::selectClause &, const ibis::constPartList &, const ibis::whereClause &)
Select the rows satisfying the where clause and store the results in a table object.
Definition: filter.cpp:1365
static table * sift0(const ibis::selectClause &, const ibis::constPartList &)
Select all rows from each data partition and place them in a table object.
Definition: filter.cpp:594
A data structure to represent a sequence of bits.
Definition: bitvector.h:62
virtual int64_t count() const
Produce the exact number of hits.
Definition: filter.cpp:197
virtual table * select() const
Produce a projection of the joint table.
Definition: filter.cpp:310
static table * sift1(const ibis::selectClause &, const ibis::constPartList &, const ibis::whereClause &)
Select the rows satisfying the where clause and store the results in a table object.
Definition: filter.cpp:980
Declares ibis::whereClause class.
const ibis::selectClause * sel_
The select clause.
Definition: filter.h:81
const ibis::constPartList * parts_
A list of data partitions to query.
Definition: filter.h:77
static table * sift(const ibis::selectClause &sel, const ibis::constPartList &pl, const ibis::whereClause &wc)
Select the rows satisfying the where clause and store the results in a table object.
Definition: filter.cpp:557

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