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

The class compRange stores computed ranges. More...

#include <qExpr.h>

Inheritance diagram for ibis::compRange:
ibis::qExpr

Public Member Functions

 compRange ()
 Default constructor.
 
 compRange (ibis::math::term *me1, COMPARE lop, ibis::math::term *me2)
 Constructor with two arithmetic expressions. More...
 
 compRange (ibis::math::term *me1, ibis::qExpr::COMPARE lop, ibis::math::term *me2, ibis::qExpr::COMPARE rop, ibis::math::term *me3)
 Constructor with three arithmetic expressions. More...
 
 compRange (const compRange &rhs)
 Copy constructor. Deep copy – actually copy the math expressions.
 
virtual qExprdup () const
 Duplicate this object. Return a pointer to the new copy.
 
virtual void getTableNames (std::set< std::string > &plist) const
 Identify the data partitions involved in the query expression. More...
 
ibis::math::termgetTerm3 ()
 
const ibis::math::termgetTerm3 () const
 
bool inRange () const
 Evaluate the logical expression. More...
 
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 isSimpleRange () const
 Is this a simple range expression that can be stored as ibis::qRange?
 
ibis::qExpr::COMPARE leftOperator () const
 
bool maybeStringCompare () const
 Is the expression possibly a simple string comparison?
 
virtual uint32_t nItems () const
 Count the number of items in the query expression.
 
virtual void print (std::ostream &) const
 Print the query expression.
 
virtual void printFull (std::ostream &out) const
 Print out the full expression. More...
 
ibis::qExpr::COMPARE rightOperator () const
 
void setTerm3 (ibis::math::term *t)
 
ibis::qContinuousRangesimpleRange () const
 
virtual ~compRange ()
 Destructor.
 
- 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.
 
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...
 

Static Public Member Functions

static compRangemakeConstantFalse ()
 Create a constant expression that always evaluates to false.
 
static compRangemakeConstantTrue ()
 Create a constant expression that always evaluates to true.
 
- 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...
 

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...
 
- 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

The class compRange stores computed ranges.

It is for those comparisons involving nontrivial arithmetic expression.

Constructor & Destructor Documentation

ibis::compRange::compRange ( ibis::math::term me1,
COMPARE  lop,
ibis::math::term me2 
)
inline

Constructor with two arithmetic expressions.

Takes the ownership of me1 and me2.

ibis::compRange::compRange ( ibis::math::term me1,
ibis::qExpr::COMPARE  lop,
ibis::math::term me2,
ibis::qExpr::COMPARE  rop,
ibis::math::term me3 
)
inline

Constructor with three arithmetic expressions.

Takes the ownership of me1, me2, and me3.

Member Function Documentation

void ibis::compRange::getTableNames ( std::set< std::string > &  plist) const
virtual

Identify the data partitions involved in the query expression.

Return the list of data partition names in a set.

It records a '*' for the variables without explicit partition names.

Reimplemented from ibis::qExpr.

bool ibis::compRange::inRange ( ) const
inline

Evaluate the logical expression.

Does the input value match any of the values on record ? It returns false in case of error.

References ibis::math::term::eval().

Referenced by ibis::query::doEstimate(), ibis::countQuery::doEvaluate(), ibis::query::doEvaluate(), ibis::countQuery::doScan(), ibis::part::doScan(), and ibis::query::doScan().

virtual bool ibis::compRange::isConstant ( ) const
inlinevirtual

Is this expression a constant? A constant remains the same not matter which row it is applied to.

Reimplemented from ibis::qExpr.

References ibis::qExpr::getLeft(), and ibis::qExpr::getRight().

Referenced by ibis::query::doEstimate(), ibis::countQuery::doEvaluate(), ibis::query::doEvaluate(), ibis::countQuery::doScan(), and ibis::query::doScan().

virtual bool ibis::compRange::isSimple ( ) const
inlinevirtual

Is the expression simple? A simple expression contains only range conditions connected with logical operators.

Reimplemented from ibis::qExpr.

References isSimpleRange().

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

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.

References print().


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