You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Reformat all code to coding standard
This commit is contained in:
@ -34,9 +34,10 @@
|
||||
/**
|
||||
* Namespace
|
||||
*/
|
||||
namespace execplan {
|
||||
class SimpleColumn;
|
||||
class AggregateColumn;
|
||||
namespace execplan
|
||||
{
|
||||
class SimpleColumn;
|
||||
class AggregateColumn;
|
||||
|
||||
/**
|
||||
* @brief A class to represent a arithmetic expression return column
|
||||
@ -44,203 +45,218 @@ namespace execplan {
|
||||
* This class is a specialization of class ReturnedColumn that
|
||||
* handles an arithmetic expression.
|
||||
*/
|
||||
class ArithmeticColumn : public ReturnedColumn {
|
||||
class ArithmeticColumn : public ReturnedColumn
|
||||
{
|
||||
public:
|
||||
ArithmeticColumn();
|
||||
ArithmeticColumn( const std::string& sql, const uint32_t sessionID=0 );
|
||||
ArithmeticColumn( const ArithmeticColumn& rhs, const uint32_t sessionID=0 );
|
||||
virtual ~ArithmeticColumn();
|
||||
ArithmeticColumn();
|
||||
ArithmeticColumn( const std::string& sql, const uint32_t sessionID = 0 );
|
||||
ArithmeticColumn( const ArithmeticColumn& rhs, const uint32_t sessionID = 0 );
|
||||
virtual ~ArithmeticColumn();
|
||||
|
||||
inline ParseTree* expression() const
|
||||
{
|
||||
return fExpression;
|
||||
}
|
||||
inline ParseTree* expression() const
|
||||
{
|
||||
return fExpression;
|
||||
}
|
||||
|
||||
/** get table alias name
|
||||
*
|
||||
* get the table alias name for this arithmetic function
|
||||
*/
|
||||
inline const std::string& tableAlias () const
|
||||
{
|
||||
return fTableAlias;
|
||||
}
|
||||
/** get table alias name
|
||||
*
|
||||
* get the table alias name for this arithmetic function
|
||||
*/
|
||||
inline const std::string& tableAlias () const
|
||||
{
|
||||
return fTableAlias;
|
||||
}
|
||||
|
||||
/** set table alias name
|
||||
*
|
||||
* set the table alias name for this arithmetic function
|
||||
*/
|
||||
inline void tableAlias (const std::string& tableAlias)
|
||||
{
|
||||
fTableAlias = tableAlias;
|
||||
}
|
||||
/** set table alias name
|
||||
*
|
||||
* set the table alias name for this arithmetic function
|
||||
*/
|
||||
inline void tableAlias (const std::string& tableAlias)
|
||||
{
|
||||
fTableAlias = tableAlias;
|
||||
}
|
||||
|
||||
/** set the parse tree
|
||||
*
|
||||
* set the parse tree to expression.
|
||||
* @note this object takes ownership of the tree. The supplied pointer is set to null.
|
||||
*/
|
||||
void expression (ParseTree*& expression);
|
||||
/** set the parse tree
|
||||
*
|
||||
* set the parse tree to expression.
|
||||
* @note this object takes ownership of the tree. The supplied pointer is set to null.
|
||||
*/
|
||||
void expression (ParseTree*& expression);
|
||||
|
||||
/**
|
||||
* get asc flag
|
||||
*/
|
||||
inline const bool asc() const { return fAsc; }
|
||||
/**
|
||||
* get asc flag
|
||||
*/
|
||||
inline const bool asc() const
|
||||
{
|
||||
return fAsc;
|
||||
}
|
||||
|
||||
/**
|
||||
* set asc flag
|
||||
*/
|
||||
inline void asc(const bool asc) { fAsc = asc; }
|
||||
/**
|
||||
* set asc flag
|
||||
*/
|
||||
inline void asc(const bool asc)
|
||||
{
|
||||
fAsc = asc;
|
||||
}
|
||||
|
||||
/**
|
||||
* get SQL representation of this object
|
||||
*/
|
||||
virtual const std::string data() const { return fData; }
|
||||
/**
|
||||
* get SQL representation of this object
|
||||
*/
|
||||
virtual const std::string data() const
|
||||
{
|
||||
return fData;
|
||||
}
|
||||
|
||||
/**
|
||||
* set SQL representation of this object
|
||||
*/
|
||||
virtual void data(const std::string data) { fData = data; }
|
||||
/**
|
||||
* set SQL representation of this object
|
||||
*/
|
||||
virtual void data(const std::string data)
|
||||
{
|
||||
fData = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* virtual stream method
|
||||
*/
|
||||
virtual const std::string toString() const;
|
||||
/**
|
||||
* virtual stream method
|
||||
*/
|
||||
virtual const std::string toString() const;
|
||||
|
||||
/** return a copy of this pointer
|
||||
*
|
||||
* deep copy of this pointer and return the copy
|
||||
*/
|
||||
inline virtual ArithmeticColumn* clone() const
|
||||
{
|
||||
return new ArithmeticColumn (*this);
|
||||
}
|
||||
/** return a copy of this pointer
|
||||
*
|
||||
* deep copy of this pointer and return the copy
|
||||
*/
|
||||
inline virtual ArithmeticColumn* clone() const
|
||||
{
|
||||
return new ArithmeticColumn (*this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ArithmeticColumn& 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 ArithmeticColumn& 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 ArithmeticColumn& 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 ArithmeticColumn& t) const;
|
||||
|
||||
virtual bool hasAggregate();
|
||||
virtual bool hasWindowFunc();
|
||||
virtual bool hasAggregate();
|
||||
virtual bool hasWindowFunc();
|
||||
|
||||
virtual void setDerivedTable();
|
||||
virtual void replaceRealCol(std::vector<SRCP>&);
|
||||
virtual const std::vector<SimpleColumn*>& simpleColumnList() const
|
||||
{ return fSimpleColumnList; }
|
||||
virtual void setSimpleColumnList();
|
||||
virtual void setDerivedTable();
|
||||
virtual void replaceRealCol(std::vector<SRCP>&);
|
||||
virtual const std::vector<SimpleColumn*>& simpleColumnList() const
|
||||
{
|
||||
return fSimpleColumnList;
|
||||
}
|
||||
virtual void setSimpleColumnList();
|
||||
|
||||
/**
|
||||
* Return the table that the column arguments belong to.
|
||||
*
|
||||
* @return tablename, if all arguments belong to one table
|
||||
* empty string "", if multiple tables are involved in this func
|
||||
*/
|
||||
virtual bool singleTable(CalpontSystemCatalog::TableAliasName& tan);
|
||||
/**
|
||||
* Return the table that the column arguments belong to.
|
||||
*
|
||||
* @return tablename, if all arguments belong to one table
|
||||
* empty string "", if multiple tables are involved in this func
|
||||
*/
|
||||
virtual bool singleTable(CalpontSystemCatalog::TableAliasName& tan);
|
||||
|
||||
private:
|
||||
std::string fTableAlias; // table alias for this column
|
||||
bool fAsc; // asc flag for order by column
|
||||
std::string fData;
|
||||
std::string fTableAlias; // table alias for this column
|
||||
bool fAsc; // asc flag for order by column
|
||||
std::string fData;
|
||||
|
||||
/** build expression tree
|
||||
*
|
||||
* this function is called by the constructor. the incomming
|
||||
* sql string is parsed and tokenized and built into a
|
||||
* parse tree.
|
||||
*/
|
||||
void buildTree();
|
||||
/** build expression tree
|
||||
*
|
||||
* this function is called by the constructor. the incomming
|
||||
* sql string is parsed and tokenized and built into a
|
||||
* parse tree.
|
||||
*/
|
||||
void buildTree();
|
||||
|
||||
/** get next token from expression
|
||||
*
|
||||
* this is a util function used by buildTree(). next token string
|
||||
* is retrived from expression from curPos, until end char.
|
||||
* return the retrived token. curPos reference is updated to the
|
||||
* new position after end char
|
||||
*/
|
||||
const std::string nextToken(std::string::size_type &curPos, char end) const;
|
||||
/** get next token from expression
|
||||
*
|
||||
* this is a util function used by buildTree(). next token string
|
||||
* is retrived from expression from curPos, until end char.
|
||||
* return the retrived token. curPos reference is updated to the
|
||||
* new position after end char
|
||||
*/
|
||||
const std::string nextToken(std::string::size_type& curPos, char end) const;
|
||||
|
||||
/***********************************************************
|
||||
* F&E framework *
|
||||
***********************************************************/
|
||||
/***********************************************************
|
||||
* F&E framework *
|
||||
***********************************************************/
|
||||
public:
|
||||
virtual const std::string& getStrVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getStrVal(row, isNull);
|
||||
}
|
||||
virtual const std::string& getStrVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getStrVal(row, isNull);
|
||||
}
|
||||
|
||||
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getIntVal(row, isNull);
|
||||
}
|
||||
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getIntVal(row, isNull);
|
||||
}
|
||||
|
||||
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getUintVal(row, isNull);
|
||||
}
|
||||
|
||||
virtual float getFloatVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getFloatVal(row, isNull);
|
||||
}
|
||||
virtual float getFloatVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getFloatVal(row, isNull);
|
||||
}
|
||||
|
||||
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getDoubleVal(row, isNull);
|
||||
}
|
||||
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getDoubleVal(row, isNull);
|
||||
}
|
||||
|
||||
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getDecimalVal(row, isNull);
|
||||
}
|
||||
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getDecimalVal(row, isNull);
|
||||
}
|
||||
|
||||
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getDateIntVal(row, isNull);
|
||||
}
|
||||
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getDateIntVal(row, isNull);
|
||||
}
|
||||
|
||||
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getDatetimeIntVal(row, isNull);
|
||||
}
|
||||
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getDatetimeIntVal(row, isNull);
|
||||
}
|
||||
|
||||
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getBoolVal(row, isNull);
|
||||
}
|
||||
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull)
|
||||
{
|
||||
return fExpression->getBoolVal(row, isNull);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
ParseTree* fExpression;
|
||||
void evaluate(rowgroup::Row& row) {}
|
||||
ParseTree* fExpression;
|
||||
void evaluate(rowgroup::Row& row) {}
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user