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:
@ -36,7 +36,7 @@
|
||||
|
||||
namespace rowgroup
|
||||
{
|
||||
class Row;
|
||||
class Row;
|
||||
}
|
||||
|
||||
namespace execplan
|
||||
@ -55,89 +55,114 @@ typedef std::vector<execplan::SPTP> FunctionParm;
|
||||
class Func
|
||||
{
|
||||
public:
|
||||
Func();
|
||||
Func(const std::string& funcName);
|
||||
virtual ~Func() {}
|
||||
Func();
|
||||
Func(const std::string& funcName);
|
||||
virtual ~Func() {}
|
||||
|
||||
const std::string funcName() const { return fFuncName; }
|
||||
void funcName(const std::string funcName) { fFuncName = funcName; }
|
||||
virtual execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) = 0;
|
||||
const std::string funcName() const
|
||||
{
|
||||
return fFuncName;
|
||||
}
|
||||
void funcName(const std::string funcName)
|
||||
{
|
||||
fFuncName = funcName;
|
||||
}
|
||||
virtual execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) = 0;
|
||||
|
||||
virtual int64_t getIntVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct) = 0;
|
||||
virtual int64_t getIntVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct) = 0;
|
||||
|
||||
virtual uint64_t getUintVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{ return static_cast<uint64_t>(getIntVal(row,fp,isNull,op_ct)); }
|
||||
{
|
||||
return static_cast<uint64_t>(getIntVal(row, fp, isNull, op_ct));
|
||||
}
|
||||
|
||||
virtual double getDoubleVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct) = 0;
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct) = 0;
|
||||
|
||||
virtual std::string getStrVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct) = 0;
|
||||
virtual std::string getStrVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct) = 0;
|
||||
|
||||
virtual execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{ return execplan::IDB_Decimal(getIntVal(row, fp, isNull, op_ct),0,0); }
|
||||
virtual execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
return execplan::IDB_Decimal(getIntVal(row, fp, isNull, op_ct), 0, 0);
|
||||
}
|
||||
|
||||
virtual int32_t getDateIntVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{ return intToDate(getIntVal(row, fp, isNull, op_ct)); }
|
||||
virtual int32_t getDateIntVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
return intToDate(getIntVal(row, fp, isNull, op_ct));
|
||||
}
|
||||
|
||||
virtual int64_t getDatetimeIntVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{ return intToDatetime(getIntVal(row, fp, isNull, op_ct)); }
|
||||
virtual int64_t getDatetimeIntVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
return intToDatetime(getIntVal(row, fp, isNull, op_ct));
|
||||
}
|
||||
|
||||
virtual bool getBoolVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{ int64_t intVal = getIntVal(row, fp, isNull, op_ct); return (!isNull && intVal); }
|
||||
virtual bool getBoolVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
int64_t intVal = getIntVal(row, fp, isNull, op_ct);
|
||||
return (!isNull && intVal);
|
||||
}
|
||||
|
||||
virtual float getFloatVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{ return getDoubleVal(row, fp, isNull, op_ct); }
|
||||
virtual float getFloatVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
return getDoubleVal(row, fp, isNull, op_ct);
|
||||
}
|
||||
|
||||
const float floatNullVal() const { return fFloatNullVal; }
|
||||
const double doubleNullVal() const { return fDoubleNullVal; }
|
||||
const float floatNullVal() const
|
||||
{
|
||||
return fFloatNullVal;
|
||||
}
|
||||
const double doubleNullVal() const
|
||||
{
|
||||
return fDoubleNullVal;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual uint32_t stringToDate(std::string);
|
||||
virtual uint64_t stringToDatetime(std::string);
|
||||
virtual uint32_t stringToDate(std::string);
|
||||
virtual uint64_t stringToDatetime(std::string);
|
||||
|
||||
virtual uint32_t intToDate(int64_t);
|
||||
virtual uint64_t intToDatetime(int64_t);
|
||||
virtual uint32_t intToDate(int64_t);
|
||||
virtual uint64_t intToDatetime(int64_t);
|
||||
|
||||
virtual std::string intToString(int64_t);
|
||||
virtual std::string doubleToString(double);
|
||||
virtual std::string intToString(int64_t);
|
||||
virtual std::string doubleToString(double);
|
||||
|
||||
std::string fFuncName;
|
||||
std::string fFuncName;
|
||||
|
||||
private:
|
||||
//defaults okay
|
||||
//Func(const Func& rhs);
|
||||
//Func& operator=(const Func& rhs);
|
||||
//defaults okay
|
||||
//Func(const Func& rhs);
|
||||
//Func& operator=(const Func& rhs);
|
||||
|
||||
void init();
|
||||
void init();
|
||||
|
||||
float fFloatNullVal;
|
||||
double fDoubleNullVal;
|
||||
float fFloatNullVal;
|
||||
double fDoubleNullVal;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user