You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
clang format apply
This commit is contained in:
@ -17,10 +17,10 @@
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/***********************************************************************
|
||||
* $Id: operator.h 9635 2013-06-19 21:42:30Z bwilkinson $
|
||||
*
|
||||
*
|
||||
***********************************************************************/
|
||||
* $Id: operator.h 9635 2013-06-19 21:42:30Z bwilkinson $
|
||||
*
|
||||
*
|
||||
***********************************************************************/
|
||||
/** @file */
|
||||
|
||||
#pragma once
|
||||
@ -42,206 +42,206 @@ class ReturnedColumn;
|
||||
|
||||
enum OpType
|
||||
{
|
||||
OP_ADD = 0,
|
||||
OP_SUB,
|
||||
OP_MUL,
|
||||
OP_DIV,
|
||||
OP_EQ,
|
||||
OP_NE,
|
||||
OP_GT,
|
||||
OP_GE,
|
||||
OP_LT,
|
||||
OP_LE,
|
||||
OP_LIKE,
|
||||
OP_NOTLIKE,
|
||||
OP_AND,
|
||||
OP_OR,
|
||||
OP_ISNULL,
|
||||
OP_ISNOTNULL,
|
||||
OP_BETWEEN,
|
||||
OP_NOTBETWEEN,
|
||||
OP_IN,
|
||||
OP_NOTIN,
|
||||
OP_XOR,
|
||||
OP_UNKNOWN,
|
||||
OP_ADD = 0,
|
||||
OP_SUB,
|
||||
OP_MUL,
|
||||
OP_DIV,
|
||||
OP_EQ,
|
||||
OP_NE,
|
||||
OP_GT,
|
||||
OP_GE,
|
||||
OP_LT,
|
||||
OP_LE,
|
||||
OP_LIKE,
|
||||
OP_NOTLIKE,
|
||||
OP_AND,
|
||||
OP_OR,
|
||||
OP_ISNULL,
|
||||
OP_ISNOTNULL,
|
||||
OP_BETWEEN,
|
||||
OP_NOTBETWEEN,
|
||||
OP_IN,
|
||||
OP_NOTIN,
|
||||
OP_XOR,
|
||||
OP_UNKNOWN,
|
||||
};
|
||||
|
||||
class Operator : public TreeNode
|
||||
{
|
||||
public:
|
||||
Operator();
|
||||
Operator(const std::string& operatorName);
|
||||
Operator(const Operator& rhs);
|
||||
|
||||
public:
|
||||
Operator();
|
||||
Operator(const std::string& operatorName);
|
||||
Operator(const Operator& rhs);
|
||||
virtual ~Operator();
|
||||
|
||||
virtual ~Operator();
|
||||
virtual const std::string toString() const;
|
||||
virtual const std::string data() const
|
||||
{
|
||||
return fData;
|
||||
}
|
||||
virtual void data(const std::string data);
|
||||
|
||||
virtual const std::string toString() const;
|
||||
virtual const std::string data() const
|
||||
{
|
||||
return fData;
|
||||
}
|
||||
virtual void data(const std::string data);
|
||||
/** return a copy of this pointer
|
||||
*
|
||||
* deep copy of this pointer and return the copy
|
||||
*/
|
||||
inline virtual Operator* clone() const
|
||||
{
|
||||
return new Operator(*this);
|
||||
}
|
||||
|
||||
/** return a copy of this pointer
|
||||
*
|
||||
* deep copy of this pointer and return the copy
|
||||
*/
|
||||
inline virtual Operator* clone() const
|
||||
{
|
||||
return new Operator (*this);
|
||||
}
|
||||
/** return the opposite operator
|
||||
* @note this is not a compliment of operator. this is for the case that
|
||||
* the two operands of operator get switched, and the operator needs to
|
||||
* be reversed. e.g., where C1 > C2 ==> where C2 < C1
|
||||
*/
|
||||
virtual Operator* opposite() const;
|
||||
|
||||
/** return the opposite operator
|
||||
* @note this is not a compliment of operator. this is for the case that
|
||||
* the two operands of operator get switched, and the operator needs to
|
||||
* be reversed. e.g., where C1 > C2 ==> where C2 < C1
|
||||
*/
|
||||
virtual Operator* opposite() const;
|
||||
/**
|
||||
* The serialization interface
|
||||
*/
|
||||
virtual void serialize(messageqcpp::ByteStream&) const;
|
||||
virtual void unserialize(messageqcpp::ByteStream&);
|
||||
|
||||
/**
|
||||
* The serialization interface
|
||||
*/
|
||||
virtual void serialize(messageqcpp::ByteStream&) const;
|
||||
virtual void unserialize(messageqcpp::ByteStream&);
|
||||
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
|
||||
*
|
||||
* Do a deep, strict (as opposed to semantic) equivalence test.
|
||||
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
|
||||
*/
|
||||
virtual bool operator==(const TreeNode* t) const;
|
||||
|
||||
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
|
||||
*
|
||||
* Do a deep, strict (as opposed to semantic) equivalence test.
|
||||
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
|
||||
*/
|
||||
virtual bool operator==(const TreeNode* t) const;
|
||||
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
|
||||
*
|
||||
* Do a deep, strict (as opposed to semantic) equivalence test.
|
||||
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
|
||||
*/
|
||||
bool operator==(const Operator& t) const;
|
||||
|
||||
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
|
||||
*
|
||||
* Do a deep, strict (as opposed to semantic) equivalence test.
|
||||
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise
|
||||
*/
|
||||
bool operator==(const Operator& t) const;
|
||||
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
|
||||
*
|
||||
* Do a deep, strict (as opposed to semantic) equivalence test.
|
||||
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
|
||||
*/
|
||||
virtual bool operator!=(const TreeNode* t) const;
|
||||
|
||||
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
|
||||
*
|
||||
* Do a deep, strict (as opposed to semantic) equivalence test.
|
||||
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
|
||||
*/
|
||||
virtual bool operator!=(const TreeNode* t) const;
|
||||
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
|
||||
*
|
||||
* Do a deep, strict (as opposed to semantic) equivalence test.
|
||||
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
|
||||
*/
|
||||
bool operator!=(const Operator& t) const;
|
||||
|
||||
/** @brief Do a deep, strict (as opposed to semantic) equivalence test
|
||||
*
|
||||
* Do a deep, strict (as opposed to semantic) equivalence test.
|
||||
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise
|
||||
*/
|
||||
bool operator!=(const Operator& t) const;
|
||||
/** @breif reverse the operator
|
||||
*
|
||||
* Literally reverse the operator, as left operand and right operand are swapped, or a NOT
|
||||
* is applied before the operator
|
||||
*/
|
||||
virtual void reverseOp();
|
||||
|
||||
/** @breif reverse the operator
|
||||
*
|
||||
* Literally reverse the operator, as left operand and right operand are swapped, or a NOT
|
||||
* is applied before the operator
|
||||
*/
|
||||
virtual void reverseOp();
|
||||
protected:
|
||||
std::string fData;
|
||||
|
||||
protected:
|
||||
std::string fData;
|
||||
/***********************************************************
|
||||
* F&E framework *
|
||||
***********************************************************/
|
||||
public:
|
||||
virtual OpType op() const
|
||||
{
|
||||
return fOp;
|
||||
}
|
||||
virtual void op(const OpType op)
|
||||
{
|
||||
fOp = op;
|
||||
}
|
||||
using TreeNode::evaluate;
|
||||
virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
}
|
||||
|
||||
/***********************************************************
|
||||
* F&E framework *
|
||||
***********************************************************/
|
||||
public:
|
||||
virtual OpType op() const
|
||||
{
|
||||
return fOp;
|
||||
}
|
||||
virtual void op(const OpType op)
|
||||
{
|
||||
fOp = op;
|
||||
}
|
||||
using TreeNode::evaluate;
|
||||
virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) {}
|
||||
// The following methods should be pure virtual. Currently too many instanslization exists.
|
||||
using TreeNode::getStrVal;
|
||||
virtual const std::string& getStrVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.strVal;
|
||||
}
|
||||
using TreeNode::getIntVal;
|
||||
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.intVal;
|
||||
}
|
||||
using TreeNode::getUintVal;
|
||||
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.uintVal;
|
||||
}
|
||||
using TreeNode::getFloatVal;
|
||||
virtual float getFloatVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.floatVal;
|
||||
}
|
||||
using TreeNode::getDoubleVal;
|
||||
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.doubleVal;
|
||||
}
|
||||
using TreeNode::getLongDoubleVal;
|
||||
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.longDoubleVal;
|
||||
}
|
||||
using TreeNode::getDecimalVal;
|
||||
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.decimalVal;
|
||||
}
|
||||
using TreeNode::getDateIntVal;
|
||||
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.intVal;
|
||||
}
|
||||
using TreeNode::getDatetimeIntVal;
|
||||
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.intVal;
|
||||
}
|
||||
using TreeNode::getTimestampIntVal;
|
||||
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.intVal;
|
||||
}
|
||||
using TreeNode::getTimeIntVal;
|
||||
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.intVal;
|
||||
}
|
||||
using TreeNode::getBoolVal;
|
||||
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.boolVal;
|
||||
}
|
||||
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ReturnedColumn* lop, ReturnedColumn* rop)
|
||||
{
|
||||
return fResult.boolVal;
|
||||
}
|
||||
|
||||
// The following methods should be pure virtual. Currently too many instanslization exists.
|
||||
using TreeNode::getStrVal;
|
||||
virtual const std::string& getStrVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.strVal;
|
||||
}
|
||||
using TreeNode::getIntVal;
|
||||
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.intVal;
|
||||
}
|
||||
using TreeNode::getUintVal;
|
||||
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.uintVal;
|
||||
}
|
||||
using TreeNode::getFloatVal;
|
||||
virtual float getFloatVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.floatVal;
|
||||
}
|
||||
using TreeNode::getDoubleVal;
|
||||
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.doubleVal;
|
||||
}
|
||||
using TreeNode::getLongDoubleVal;
|
||||
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.longDoubleVal;
|
||||
}
|
||||
using TreeNode::getDecimalVal;
|
||||
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.decimalVal;
|
||||
}
|
||||
using TreeNode::getDateIntVal;
|
||||
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.intVal;
|
||||
}
|
||||
using TreeNode::getDatetimeIntVal;
|
||||
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.intVal;
|
||||
}
|
||||
using TreeNode::getTimestampIntVal;
|
||||
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.intVal;
|
||||
}
|
||||
using TreeNode::getTimeIntVal;
|
||||
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.intVal;
|
||||
}
|
||||
using TreeNode::getBoolVal;
|
||||
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop)
|
||||
{
|
||||
return fResult.boolVal;
|
||||
}
|
||||
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ReturnedColumn* lop, ReturnedColumn* rop)
|
||||
{
|
||||
return fResult.boolVal;
|
||||
}
|
||||
virtual void setOpType(Type& l, Type& r)
|
||||
{
|
||||
}
|
||||
virtual void operationType(const Type& ot)
|
||||
{
|
||||
fOperationType = ot;
|
||||
}
|
||||
virtual const Type& operationType() const
|
||||
{
|
||||
return fOperationType;
|
||||
}
|
||||
|
||||
virtual void setOpType(Type& l, Type& r) {}
|
||||
virtual void operationType(const Type& ot)
|
||||
{
|
||||
fOperationType = ot;
|
||||
}
|
||||
virtual const Type& operationType() const
|
||||
{
|
||||
return fOperationType;
|
||||
}
|
||||
|
||||
protected:
|
||||
OpType fOp;
|
||||
protected:
|
||||
OpType fOp;
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<Operator> SOP;
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const Operator& rhs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace execplan
|
||||
|
Reference in New Issue
Block a user