Column-oriented GPU-accelerated Database Management System
CoGaDB
CoGaDB::SQL::ParseTree::ComparisonPredicate Struct Reference

#include <sql_parsetree.hpp>

Inheritance diagram for CoGaDB::SQL::ParseTree::ComparisonPredicate:
Collaboration diagram for CoGaDB::SQL::ParseTree::ComparisonPredicate:

List of all members.

Public Member Functions

 ComparisonPredicate (ScalarExpressionPtr _lvalue, ValueComparator _op, ScalarExpressionPtr _rvalue)
KNF_Selection_Expression getCNF (TypedNodePtr &io_node)
 Get Conjunctive Normal Form of a search condition predicate.

Public Attributes

ScalarExpressionPtr lvalue
ValueComparator op
ScalarExpressionPtr rvalue

Constructor & Destructor Documentation


Member Function Documentation

Get Conjunctive Normal Form of a search condition predicate.

Converting a single predicate to CNF is trivial - it is simply wrapped in a disjunction that is wrapped in a conjunction.

Since predicates in a CNF structure have their atomic type always on the right side of the operator (as in Column > Atom), the predicate operator might have to be flipped.

See also:
CoGaDB::Predicate
Parameters:
io_nodeReference to node pointer that holds the current chain of algebraic logical operators that is updated during CNF construction.
Returns:
CNF of parse tree predicate

map SQL comparison operators to CoGaDB's limited set of operators.

Todo:
If we would save the data type in the AtomExpression we could optimize expressions like (x >= 3) to (x > 2), saving one predicate.

Implements CoGaDB::SQL::ParseTree::SearchCondition.

References CoGaDB::KNF_Selection_Expression::disjunctions, CoGaDB::EQUAL, CoGaDB::GREATER, CoGaDB::GREATER_EQUAL, CoGaDB::LESSER, CoGaDB::LESSER_EQUAL, CoGaDB::SQL::ParseTree::make_pred(), CoGaDB::SQL::ParseTree::UNEQUAL, CoGaDB::ValueConstantPredicate, and CoGaDB::ValueValuePredicate.

Here is the call graph for this function:


Member Data Documentation


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines