jnatural.h
Go to the documentation of this file.
1 // File: $Id$
2 // Author: John Wu <John.Wu at ACM.org>
3 // Copyright (c) 2008-2016 the Regents of the University of California
4 #ifndef IBIS_JNATURAL_H
5 #define IBIS_JNATURAL_H
6 
12 #include "quaere.h" // ibis::quaere
13 
14 namespace ibis {
15  class jNatural; // forward definition
16 } // namespace ibis
17 
24 class FASTBIT_CXX_DLLSPEC ibis::jNatural : public ibis::quaere {
25 public:
26  jNatural(const ibis::part* partr, const ibis::part* parts,
27  const char* colname, const char* condr, const char* conds,
28  const char* sel);
29  jNatural(const ibis::part* partr, const ibis::part* parts,
30  const ibis::column* colr, const ibis::column* cols,
31  const ibis::qExpr* condr, const ibis::qExpr* conds,
32  const ibis::selectClause* sel, const ibis::fromClause* frm,
33  const char* desc);
34  virtual ~jNatural();
35 
36  virtual void roughCount(uint64_t& nmin, uint64_t& nmax) const;
37  virtual int64_t count() const;
38 
39  virtual ibis::table* select() const;
40  virtual ibis::table* select(const char*) const;
41  virtual ibis::table* select(const ibis::table::stringArray& colnames) const;
42 
43 protected:
44  std::string desc_;
45  const ibis::selectClause *sel_;
46  const ibis::fromClause *frm_;
47  const ibis::part& R_;
48  const ibis::part& S_;
49  const ibis::column& colR_;
50  const ibis::column& colS_;
51  ibis::bitvector maskR_;
52  ibis::bitvector maskS_;
53 
54  mutable array_t<uint32_t> *orderR_;
55  mutable array_t<uint32_t> *orderS_;
56  mutable void *valR_;
57  mutable void *valS_;
58  mutable int64_t nrows;
59 
60  template <typename T>
61  static table*
62  fillResult(size_t nrows,
63  const std::string &desc,
64  const ibis::array_t<T>& rjcol,
65  const ibis::table::typeArray& rtypes,
66  const ibis::table::bufferArray& rbuff,
67  const ibis::array_t<T>& sjcol,
68  const ibis::table::typeArray& stypes,
69  const ibis::table::bufferArray& sbuff,
70  const ibis::table::stringArray& cnamet,
71  const std::vector<uint32_t>& cnpos);
72  static table*
73  fillResult(size_t nrows,
74  const std::string &desc,
75  const std::vector<std::string>& rjcol,
76  const ibis::table::typeArray& rtypes,
77  const ibis::table::bufferArray& rbuff,
78  const std::vector<std::string>& sjcol,
79  const ibis::table::typeArray& stypes,
80  const ibis::table::bufferArray& sbuff,
81  const ibis::table::stringArray& cnamet,
82  const std::vector<uint32_t>& cnpos);
83 
84 private:
85  jNatural(const jNatural&); // no copying
86  jNatural& operator=(const jNatural&); // no assignment
87 }; // class ibis::jNatural
88 #endif
In-memory Natual Join.
Definition: jnatural.h:24
The top level query expression object.
Definition: qExpr.h:36
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
The class to represent a column of a data partition.
Definition: column.h:65
FastBit Quaere Interface.
The abstract table class.
Definition: table.h:77
The class ibis::part represents a partition of a relational table.
Definition: part.h:27
jNatural(const ibis::part *partr, const ibis::part *parts, const char *colname, const char *condr, const char *conds, const char *sel)
Constructor.
Definition: jnatural.cpp:122
virtual table * select() const =0
Produce a projection of the joint table.
virtual void roughCount(uint64_t &nmin, uint64_t &nmax) const =0
Provide an estimate of the number of hits.
An abstract query interface.
Definition: quaere.h:35
A data structure to represent a sequence of bits.
Definition: bitvector.h:62
virtual int64_t count() const =0
Compute the number of results.
A class to represent the from clause.
Definition: fromClause.h:40

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