1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

clang format apply

This commit is contained in:
Leonid Fedorov
2022-01-21 16:43:49 +00:00
parent 6b6411229f
commit 04752ec546
1376 changed files with 393460 additions and 412662 deletions

View File

@ -17,10 +17,10 @@
MA 02110-1301, USA. */
/***********************************************************************
* $Id$
*
*
***********************************************************************/
* $Id$
*
*
***********************************************************************/
/**
* MariaDB ColumnStore interface for writing a user defined function (UDF).
@ -55,26 +55,23 @@
namespace udfsdk
{
/**
* UDFSDK interface. Do not make modification here.
*/
class UDFSDK
{
public:
EXPORT UDFSDK();
public:
EXPORT UDFSDK();
EXPORT ~UDFSDK();
EXPORT ~UDFSDK();
EXPORT funcexp::FuncMap UDFMap() const;
protected:
private:
//defaults okay
//UDFSDK(const UDFSDK& rhs);
//UDFSDK& operator=(const UDFSDK& rhs);
EXPORT funcexp::FuncMap UDFMap() const;
protected:
private:
// defaults okay
// UDFSDK(const UDFSDK& rhs);
// UDFSDK& operator=(const UDFSDK& rhs);
};
/**
@ -104,135 +101,122 @@ private:
*/
class MCS_add : public funcexp::Func
{
public:
/*
* Constructor. Pass the function name to the base constructor.
*/
MCS_add() : Func("mcs_add") {}
public:
/*
* Constructor. Pass the function name to the base constructor.
*/
MCS_add() : Func("mcs_add")
{
}
/*
* Destructor. MCS_add does not need to do anything here to clean up.
*/
virtual ~MCS_add() {}
/*
* Destructor. MCS_add does not need to do anything here to clean up.
*/
virtual ~MCS_add()
{
}
/**
* Decide on the function's operation type
*
* Operation type decides which API needs to be called for each function
* parameter. Sometimes it is obvious. e.g. for function substr (c1, c2, c3),
* one knows that getStrVal(), getIntVal() and getIntVal() should be called for
* the three parameters in sequence. In that case, a dummy type can be returned
* because it won't be used in the function implementation. Sometimes the
* operation type is decided by the data type of the function parameters.
* e.g., isnull(c1) function, one should call the corresponding getXXXval()
* function that in compatible with the result type of c1.
*
* @parm fp vector of function parameters
* Each element is a boost::shared_ptr of execplan::ParseTree. class
* ParseTree is defined in ~/dbcon/execplan/parsetree.h
* @parm resultType result type of this function
* Sometimes it may affect the operation type, but most of the time it
* can be ignored. Struct ColType is defined in ~/dbcon/execplan/calpontsystemcatalog.h
* @return operation type for this function
*
* This function is called only one from the connector. Once it's determined, it
* will be passed to the getXXXval() APIs during function evaluation.
*/
execplan::CalpontSystemCatalog::ColType operationType(funcexp::FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType);
/**
* Decide on the function's operation type
*
* Operation type decides which API needs to be called for each function
* parameter. Sometimes it is obvious. e.g. for function substr (c1, c2, c3),
* one knows that getStrVal(), getIntVal() and getIntVal() should be called for
* the three parameters in sequence. In that case, a dummy type can be returned
* because it won't be used in the function implementation. Sometimes the
* operation type is decided by the data type of the function parameters.
* e.g., isnull(c1) function, one should call the corresponding getXXXval()
* function that in compatible with the result type of c1.
*
* @parm fp vector of function parameters
* Each element is a boost::shared_ptr of execplan::ParseTree. class
* ParseTree is defined in ~/dbcon/execplan/parsetree.h
* @parm resultType result type of this function
* Sometimes it may affect the operation type, but most of the time it
* can be ignored. Struct ColType is defined in ~/dbcon/execplan/calpontsystemcatalog.h
* @return operation type for this function
*
* This function is called only one from the connector. Once it's determined, it
* will be passed to the getXXXval() APIs during function evaluation.
*/
execplan::CalpontSystemCatalog::ColType operationType(funcexp::FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
/**
* Returns an integer result of this function.
* All the getXXXvalue APIs take the same arguments. They will be called
* for every row in the result set when the function is being evaluated.
* So these functions needs to be efficient.
*
* @parm row reference of the current row
* @parm fp function parameters
* @parm isNull NULL indicator throughout this function evaluation.
* the same reference is passed to all the function argument
* evaluations. One always need to know if any argument is NULL
* to decide the result of the function. It's explained in detail
* in MCS_isnull() function example.
* @parm op_ct the operation type that is determined in operationType().
*
*/
virtual int64_t getIntVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a double result of this function.
*/
virtual double getDoubleVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a long double result of this function.
*/
virtual long double getLongDoubleVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a float result of this function.
*/
virtual float getFloatVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a string result of this function.
*/
virtual std::string getStrVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a bool result of this function.
*/
virtual bool getBoolVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
/**
* Returns an integer result of this function.
* All the getXXXvalue APIs take the same arguments. They will be called
* for every row in the result set when the function is being evaluated.
* So these functions needs to be efficient.
*
* @parm row reference of the current row
* @parm fp function parameters
* @parm isNull NULL indicator throughout this function evaluation.
* the same reference is passed to all the function argument
* evaluations. One always need to know if any argument is NULL
* to decide the result of the function. It's explained in detail
* in MCS_isnull() function example.
* @parm op_ct the operation type that is determined in operationType().
*
*/
virtual int64_t getIntVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a decimal result of this function.
*
* IDB_Decimal is defined in ~/execplan/treenode.h
*/
virtual execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a double result of this function.
*/
/**
* Returns an integer representation of a date result of the function.
*
* Check the date/time functions in ~/utils/funcexp for implementation
* example of this API.
*/
virtual int32_t getDateIntVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
virtual double getDoubleVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns an integer representation of a datetime result of the function.
*
* Check the date/time functions in ~/utils/funcexp for implementation
* example of this API.
*/
virtual int64_t getDatetimeIntVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a long double result of this function.
*/
virtual long double getLongDoubleVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a float result of this function.
*/
virtual float getFloatVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a string result of this function.
*/
virtual std::string getStrVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a bool result of this function.
*/
virtual bool getBoolVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a decimal result of this function.
*
* IDB_Decimal is defined in ~/execplan/treenode.h
*/
virtual execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns an integer representation of a date result of the function.
*
* Check the date/time functions in ~/utils/funcexp for implementation
* example of this API.
*/
virtual int32_t getDateIntVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns an integer representation of a datetime result of the function.
*
* Check the date/time functions in ~/utils/funcexp for implementation
* example of this API.
*/
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
};
/**
@ -242,106 +226,92 @@ public:
*/
class MCS_isnull : public funcexp::Func
{
public:
/*
* Constructor. Pass the function name to the base constructor.
*/
MCS_isnull() : Func("mcs_isnull") {}
public:
/*
* Constructor. Pass the function name to the base constructor.
*/
MCS_isnull() : Func("mcs_isnull")
{
}
/*
* Destructor. MCS_add does not need to do anything here to clean up.
*/
virtual ~MCS_isnull() {}
/*
* Destructor. MCS_add does not need to do anything here to clean up.
*/
virtual ~MCS_isnull()
{
}
/**
* Decide on the function's operation type
*/
execplan::CalpontSystemCatalog::ColType operationType(funcexp::FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType);
/**
* Decide on the function's operation type
*/
execplan::CalpontSystemCatalog::ColType operationType(funcexp::FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
/**
* Returns an integer result of this function.
*/
virtual int64_t getIntVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a double result of this function.
*/
virtual double getDoubleVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a double result of this function.
*/
virtual long double getLongDoubleVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a float result of this function.
*/
virtual float getFloatVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a string result of this function.
*/
virtual std::string getStrVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a bool result of this function.
*/
virtual bool getBoolVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
/**
* Returns an integer result of this function.
*/
virtual int64_t getIntVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a decimal result of this function.
*
* IDB_Decimal is defined in ~/execplan/treenode.h
*/
virtual execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a double result of this function.
*/
virtual double getDoubleVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns an integer representation of a date result of the function.
*
* Check the date/time functions in ~/utils/funcexp for implementation
* example of this API.
*/
virtual int32_t getDateIntVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a double result of this function.
*/
virtual long double getLongDoubleVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns an integer representation of a datetime result of the function.
*
* Check the date/time functions in ~/utils/funcexp for implementation
* example of this API.
*/
virtual int64_t getDatetimeIntVal(rowgroup::Row& row,
funcexp::FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a float result of this function.
*/
virtual float getFloatVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a string result of this function.
*/
virtual std::string getStrVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a bool result of this function.
*/
virtual bool getBoolVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns a decimal result of this function.
*
* IDB_Decimal is defined in ~/execplan/treenode.h
*/
virtual execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns an integer representation of a date result of the function.
*
* Check the date/time functions in ~/utils/funcexp for implementation
* example of this API.
*/
virtual int32_t getDateIntVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
/**
* Returns an integer representation of a datetime result of the function.
*
* Check the date/time functions in ~/utils/funcexp for implementation
* example of this API.
*/
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, funcexp::FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
};
}
} // namespace udfsdk
#undef EXPORT
// vim:ts=4 sw=4: