join.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_JOIN_H
5 #define IBIS_JOIN_H
6 
13 #include "table.h" // public data types used by FastBit
14 #include "part.h" // ibis::part
15 
16 namespace ibis {
17  class join; // forward definition
18 } // namespace ibis
19 
31 class ibis::join {
32 public:
40  static join* create(const ibis::part& partr, const ibis::part& parts,
41  const char* colname, const char* condr = 0,
42  const char* conds = 0);
43 
47  virtual void estimate(uint64_t& nmin, uint64_t& nmax) =0;
51  virtual int64_t evaluate() =0;
52 
60  virtual table* select(const std::vector<const char*>& colnames) =0;
61 
62  virtual ~join() {};
63 
64  template <typename T>
65  static table*
66  fillEquiJoinTable(size_t nrows,
67  const std::string &desc,
68  const ibis::array_t<T>& rjcol,
69  const ibis::table::typeArray& rtypes,
70  const std::vector<void*>& rbuff,
71  const ibis::array_t<T>& sjcol,
72  const ibis::table::typeArray& stypes,
73  const std::vector<void*>& sbuff,
74  const ibis::table::stringArray& cnamet,
75  const std::vector<uint32_t>& cnpos);
76  static table*
77  fillEquiJoinTable(size_t nrows,
78  const std::string &desc,
79  const std::vector<std::string>& rjcol,
80  const ibis::table::typeArray& rtypes,
81  const std::vector<void*>& rbuff,
82  const std::vector<std::string>& sjcol,
83  const ibis::table::typeArray& stypes,
84  const std::vector<void*>& sbuff,
85  const ibis::table::stringArray& cnamet,
86  const std::vector<uint32_t>& cnpos);
87 
88 protected:
89  join() {} //< Default constructor. Can only be used by derived classes.
90 
91 private:
92  join(const join&); // no copying
93  join& operator=(const join&); // no assignment
94 }; // class ibis::join
95 #endif
An abstract join interface.
Definition: join.h:31
The current implementation of FastBit is code named IBIS; most data structures and functions are in t...
Definition: bord.h:16
Template array_t is a replacement of std::vector.
Definition: array_t.h:24
The abstract table class.
Definition: table.h:77
The class ibis::part represents a partition of a relational table.
Definition: part.h:27
virtual int64_t evaluate()=0
Compute the number of results.
virtual void estimate(uint64_t &nmin, uint64_t &nmax)=0
Provide an estimate of the number of results.
virtual table * select(const std::vector< const char * > &colnames)=0
Produce a projection of the joined table.
FastBit Table Interface.
static join * create(const ibis::part &partr, const ibis::part &parts, const char *colname, const char *condr=0, const char *conds=0)
The natural join.
Definition: joinin.cpp:1360
Define the class ibis::part.

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