Public Member Functions | List of all members
ibis::qIntHod Class Reference

This query expression has similar meaning as ibis::qDiscreteRange, however, it stores the values as signed 64-bit integers. More...

#include <qExpr.h>

Inheritance diagram for ibis::qIntHod:
ibis::qRange ibis::qExpr

Public Member Functions

const char * colName () const
 Name of the column involved.
 
virtual qIntHoddup () const
 Duplicate thy self.
 
virtual bool empty () const
 Is the current range empty?
 
const ibis::array_t< int64_t > & getValues () const
 Reference to the values.
 
ibis::array_t< int64_t > & getValues ()
 Reference to the values.
 
virtual bool inRange (double val) const
 Is the argument val one of the values stored ? Return true or false. More...
 
virtual bool inRange (int64_t val) const
 Is the argument val one of the values stored ? Return true or false. More...
 
virtual double leftBound () const
 The lower bound of the range.
 
virtual uint32_t nItems () const
 Count the number of items in the query expression.
 
virtual void print (std::ostream &) const
 Print a short version of the query expression.
 
virtual void printFull (std::ostream &) const
 Print the full list of values. More...
 
 qIntHod ()
 Default constructor.
 
 qIntHod (const char *col, int64_t v1)
 Constructor. Take a single number.
 
 qIntHod (const char *col, int64_t v1, int64_t v2)
 Constructor. Take two numbers.
 
 qIntHod (const char *col, const char *nums)
 Constructor. More...
 
 qIntHod (const char *col, const std::vector< int64_t > &nums)
 Constructor. More...
 
 qIntHod (const char *col, const ibis::array_t< int64_t > &nums)
 Constructor. More...
 
 qIntHod (const qIntHod &ih)
 Copy constructor.
 
virtual void restrictRange (double, double)
 Reduce the range to be no more than [left, right].
 
virtual double rightBound () const
 The upper bound of the range.
 
virtual ~qIntHod ()
 Destructor.
 
- Public Member Functions inherited from ibis::qRange
virtual void getTableNames (std::set< std::string > &plist) const
 Identify the data partitions involved in the query expression. More...
 
- Public Member Functions inherited from ibis::qExpr
bool directEval () const
 Can the expression be directly evaluated?
 
void extractDeprecatedJoins (std::vector< const deprecatedJoin * > &) const
 Extract conjunctive terms of the deprecated joins.
 
qRangefindRange (const char *vname)
 Find the first range condition involving the named variable.
 
void getConjunctiveTerms (termTableList &) const
 Extract the top-level conjunctive terms. More...
 
qExpr *& getLeft ()
 Return a pointer to the left child. More...
 
const qExprgetLeft () const
 Return a const pointer to the left child.
 
qExpr *& getRight ()
 Return a pointer to the right child. More...
 
const qExprgetRight () const
 Return a const pointer to the right child.
 
TYPE getType () const
 Return the node type.
 
virtual bool isConstant () const
 Is this expression a constant? A constant remains the same not matter which row it is applied to. More...
 
virtual bool isSimple () const
 Is the expression simple? A simple expression contains only range conditions connected with logical operators. More...
 
bool isTerminal () const
 Is this expression a terminal node of an expression tree?
 
qExproperator= (const qExpr &rhs)
 Assignment operator.
 
 qExpr ()
 Default constructor. It generates a node of undefined type.
 
 qExpr (TYPE op)
 Construct a node of specified type. Not for implicit type conversion.
 
 qExpr (TYPE op, qExpr *qe1, qExpr *qe2)
 Construct a full specified node. More...
 
 qExpr (const qExpr &qe)
 Copy Constructor. Deep copy.
 
double reorder (const weight &)
 After reordering, the lightest weight is one the left side of a group of commutable operators. More...
 
int separateSimple (ibis::qExpr *&simple, ibis::qExpr *&tail) const
 Separate an expression tree into two connected with an AND operator. More...
 
void setLeft (qExpr *expr)
 Change the left child. More...
 
void setRight (qExpr *expr)
 Change the right child. More...
 
void swap (qExpr &rhs)
 Swap the content. No exception expected.
 
virtual ~qExpr ()
 Destructor. More...
 

Additional Inherited Members

- Public Types inherited from ibis::qExpr
enum  COMPARE {
  OP_UNDEFINED, OP_LT, OP_GT, OP_LE,
  OP_GE, OP_EQ
}
 Comparison operator supported in RANGE.
 
typedef std::vector< TTNtermTableList
 
enum  TYPE {
  LOGICAL_UNDEFINED, LOGICAL_NOT, LOGICAL_AND, LOGICAL_OR,
  LOGICAL_XOR, LOGICAL_MINUS, RANGE, DRANGE,
  STRING, ANYSTRING, KEYWORD, ALLWORDS,
  COMPRANGE, MATHTERM, DEPRECATEDJOIN, TOPK,
  EXISTS, ANYANY, LIKE, INTHOD,
  UINTHOD
}
 Definition of node types. More...
 
- Static Public Member Functions inherited from ibis::qExpr
static std::string extractTableName (const char *)
 Extract the data partition name from the column name cn. More...
 
static void simplify (ibis::qExpr *&)
 Attempt to simplify the query expressions. More...
 
static void splitColumnName (const char *, std::string &, std::string &)
 Split the incoming name into data partition name and column name. More...
 
- Protected Member Functions inherited from ibis::qRange
 qRange (TYPE t)
 
- Protected Member Functions inherited from ibis::qExpr
void adjust ()
 Adjust the tree to favor the sequential evaluation order. More...
 
- Protected Attributes inherited from ibis::qExpr
qExprleft
 The left child.
 
qExprright
 The right child.
 
TYPE type
 The type of node. More...
 

Detailed Description

This query expression has similar meaning as ibis::qDiscreteRange, however, it stores the values as signed 64-bit integers.

This is primarily useful for matching 64-bit integers.

Note
About the name: hod is a portable trough for carrying mortar, bricks, and so on. We use it here as a short-hand for container. Since this class is not meant for user by others, this is a suitable obscure name for it.

Constructor & Destructor Documentation

ibis::qIntHod::qIntHod ( const char *  col,
const char *  nums 
)

Constructor.

This Constructor takes a list of values in a string. The values are extracted using the function ibis::util::readInt.

References ibis::array_t< T >::deduplicate(), ibis::util::delimiters, ibis::array_t< T >::push_back(), and ibis::util::readInt().

ibis::qIntHod::qIntHod ( const char *  col,
const std::vector< int64_t > &  nums 
)

Constructor.

The incoming values are sorted to ascending order and duplciates are removed.

References ibis::util::copy(), and ibis::array_t< T >::deduplicate().

ibis::qIntHod::qIntHod ( const char *  col,
const ibis::array_t< int64_t > &  nums 
)

Constructor.

The incoming values are sorted to the ascending order and duplicates are removed.

References ibis::array_t< T >::deduplicate().

Member Function Documentation

bool ibis::qIntHod::inRange ( double  val) const
inlinevirtual

Is the argument val one of the values stored ? Return true or false.

It uses a binary search if there are more than 32 elements and uses linear search otherwise.

Implements ibis::qRange.

Referenced by ibis::part::doCompare(), ibis::part::doCount(), and ibis::part::negativeCompare().

bool ibis::qIntHod::inRange ( int64_t  val) const
inlinevirtual

Is the argument val one of the values stored ? Return true or false.

It uses a binary search if there are more than 32 elements and uses linear search otherwise.

void ibis::qIntHod::printFull ( std::ostream &  out) const
virtual

Print the full list of values.

The number are follwed by suffix 'LL' to ensure the resulting string can be parsed back as the same expression.

Reimplemented from ibis::qExpr.


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