Simple range condition. More...
#include <qExpr.h>
Public Member Functions | |
virtual const char * | colName () const |
Returns the name of the attribute involved. | |
virtual qContinuousRange * | dup () const |
Duplicate *this. | |
virtual bool | empty () const |
Is the current range empty? | |
void | foldBoundaries () |
void | foldUnsignedBoundaries () |
virtual bool | inRange (double val) const |
Is val in the specified range? Return true if the incoming value is in the specified range. More... | |
virtual double | leftBound () const |
The lower bound of the range. | |
double & | leftBound () |
COMPARE | leftOperator () const |
COMPARE & | leftOperator () |
bool | operator< (const qContinuousRange &y) const |
An operator for comparing two query expressions. More... | |
bool | overlap (double, double) const |
virtual void | print (std::ostream &) const |
Print out the node in the string form. More... | |
virtual void | printFull (std::ostream &out) const |
Print out the full expression. More... | |
qContinuousRange () | |
Construct an empty range expression. | |
qContinuousRange (const char *lstr, COMPARE lop, const char *prop, COMPARE rop, const char *rstr) | |
Construct a range expression from strings. More... | |
qContinuousRange (const char *col, COMPARE op, uint32_t val) | |
Construct a range expression with an integer boundary. | |
qContinuousRange (const qContinuousRange &rhs) | |
Copy constructor. | |
qContinuousRange (double lv, COMPARE lop, const char *prop, COMPARE rop, double rv) | |
Construct a range expression from double-precision boundaries. | |
qContinuousRange (const char *prop, COMPARE op, double val) | |
Construct a one-side range expression. | |
virtual void | restrictRange (double left, double right) |
Reduce the range to be no more than [left, right]. | |
virtual double | rightBound () const |
The upper bound of the range. | |
double & | rightBound () |
COMPARE | rightOperator () const |
COMPARE & | rightOperator () |
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. | |
qRange * | findRange (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 qExpr * | getLeft () const |
Return a const pointer to the left child. | |
qExpr *& | getRight () |
Return a pointer to the right child. More... | |
const qExpr * | getRight () 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? | |
virtual uint32_t | nItems () const |
Count the number of items in the query expression. | |
qExpr & | operator= (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... | |
Friends | |
void | ibis::qExpr::simplify (ibis::qExpr *&) |
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< TTN > | termTableList |
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 | |
qExpr * | left |
The left child. | |
qExpr * | right |
The right child. | |
TYPE | type |
The type of node. More... | |
Simple range condition.
It is implemented as a derived class of qExpr. Possible range operator are defined in ibis::qExpr::COMPARE. It is designed to expression equality conditions, one-sided range conditions and two-sided range conditions.
/// /// /* an equality expression */ /// ibis::qExpr *expr = new ibis::qContinuousRange("a", ibis::qExpr::OP_EQ, 5.0); /// /* a one-sided range expression */ /// ibis::qExpr *expr = new ibis::qContinuousRange("a", ibis::qExpr::OP_GE, 1.3); /// /* a two-sided range expression */ /// ibis::qExpr *expr = new ibis::qContinuousRange(3.6, ibis::qExpr::OP_LE, /// "a", ibis::qExpr::OP_LT, 4.7); /// ///
ibis::qContinuousRange::qContinuousRange | ( | const char * | lstr, |
qExpr::COMPARE | lop, | ||
const char * | prop, | ||
qExpr::COMPARE | rop, | ||
const char * | rstr | ||
) |
Construct a range expression from strings.
Construct a qRange directly from a string representation of the constants.
References ibis::util::incrDouble().
|
virtual |
Is val in the specified range? Return true if the incoming value is in the specified range.
Implements ibis::qRange.
Referenced by ibis::bord::column::evaluateRange(), ibis::bin::mergeValues(), and ibis::qExpr::simplify().
|
inline |
An operator for comparing two query expressions.
The comparison is based on the name first, then the left bound and then the right bound.
References colName().
|
virtual |
Print out the node in the string form.
The short-form of the print function.
It only prints information about the current node of the query expression tree.
Reimplemented from ibis::qExpr.
|
virtual |
Print out the full expression.
The long form of the print function.
It recursively prints out the whole query expression tree, which can be quite long.
Reimplemented from ibis::qExpr.