You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
Reformat all code to coding standard
This commit is contained in:
@ -41,11 +41,11 @@ using namespace funcexp;
|
||||
|
||||
class to_lower
|
||||
{
|
||||
public:
|
||||
char operator() (char c) const // notice the return type
|
||||
{
|
||||
return tolower(c);
|
||||
}
|
||||
public:
|
||||
char operator() (char c) const // notice the return type
|
||||
{
|
||||
return tolower(c);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -55,124 +55,131 @@ namespace funcexp
|
||||
|
||||
CalpontSystemCatalog::ColType Func_least::operationType(FunctionParm& fp, CalpontSystemCatalog::ColType& resultType)
|
||||
{
|
||||
// operation type is not used by this functor
|
||||
//return fp[0]->data()->resultType();
|
||||
return resultType;
|
||||
// operation type is not used by this functor
|
||||
//return fp[0]->data()->resultType();
|
||||
return resultType;
|
||||
}
|
||||
|
||||
int64_t Func_least::getIntVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
double str = fp[0]->data()->getDoubleVal(row, isNull);
|
||||
double str = fp[0]->data()->getDoubleVal(row, isNull);
|
||||
|
||||
double leastStr = str;
|
||||
for (uint32_t i = 1; i < fp.size(); i++)
|
||||
{
|
||||
double str1 = fp[i]->data()->getDoubleVal(row, isNull);
|
||||
double leastStr = str;
|
||||
|
||||
if ( leastStr > str1 )
|
||||
leastStr = str1;
|
||||
}
|
||||
for (uint32_t i = 1; i < fp.size(); i++)
|
||||
{
|
||||
double str1 = fp[i]->data()->getDoubleVal(row, isNull);
|
||||
|
||||
return (int64_t) leastStr;
|
||||
if ( leastStr > str1 )
|
||||
leastStr = str1;
|
||||
}
|
||||
|
||||
return (int64_t) leastStr;
|
||||
}
|
||||
|
||||
double Func_least::getDoubleVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
double str = fp[0]->data()->getDoubleVal(row, isNull);
|
||||
double str = fp[0]->data()->getDoubleVal(row, isNull);
|
||||
|
||||
double leastStr = str;
|
||||
for (uint32_t i = 1; i < fp.size(); i++)
|
||||
{
|
||||
double str1 = fp[i]->data()->getDoubleVal(row, isNull);
|
||||
double leastStr = str;
|
||||
|
||||
if ( leastStr > str1 )
|
||||
leastStr = str1;
|
||||
}
|
||||
for (uint32_t i = 1; i < fp.size(); i++)
|
||||
{
|
||||
double str1 = fp[i]->data()->getDoubleVal(row, isNull);
|
||||
|
||||
return (double) leastStr;
|
||||
if ( leastStr > str1 )
|
||||
leastStr = str1;
|
||||
}
|
||||
|
||||
return (double) leastStr;
|
||||
}
|
||||
|
||||
std::string Func_least::getStrVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
string leastStr = fp[0]->data()->getStrVal(row, isNull);
|
||||
for (uint32_t i = 1; i < fp.size(); i++)
|
||||
{
|
||||
const string& str1 = fp[i]->data()->getStrVal(row, isNull);
|
||||
string leastStr = fp[0]->data()->getStrVal(row, isNull);
|
||||
|
||||
int tmp = utf8::idb_strcoll(leastStr.c_str(), str1.c_str());
|
||||
if ( tmp > 0 )
|
||||
for (uint32_t i = 1; i < fp.size(); i++)
|
||||
{
|
||||
const string& str1 = fp[i]->data()->getStrVal(row, isNull);
|
||||
|
||||
int tmp = utf8::idb_strcoll(leastStr.c_str(), str1.c_str());
|
||||
|
||||
if ( tmp > 0 )
|
||||
|
||||
// if ( leastStr > str1 )
|
||||
leastStr = str1;
|
||||
}
|
||||
leastStr = str1;
|
||||
}
|
||||
|
||||
return leastStr;
|
||||
return leastStr;
|
||||
}
|
||||
|
||||
IDB_Decimal Func_least::getDecimalVal(Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& ct)
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& ct)
|
||||
{
|
||||
IDB_Decimal str = fp[0]->data()->getDecimalVal(row, isNull);
|
||||
IDB_Decimal str = fp[0]->data()->getDecimalVal(row, isNull);
|
||||
|
||||
IDB_Decimal leastStr = str;
|
||||
for (uint32_t i = 1; i < fp.size(); i++)
|
||||
{
|
||||
IDB_Decimal str1 = fp[i]->data()->getDecimalVal(row, isNull);
|
||||
IDB_Decimal leastStr = str;
|
||||
|
||||
if ( leastStr > str1 )
|
||||
leastStr = str1;
|
||||
}
|
||||
for (uint32_t i = 1; i < fp.size(); i++)
|
||||
{
|
||||
IDB_Decimal str1 = fp[i]->data()->getDecimalVal(row, isNull);
|
||||
|
||||
return leastStr;
|
||||
if ( leastStr > str1 )
|
||||
leastStr = str1;
|
||||
}
|
||||
|
||||
return leastStr;
|
||||
}
|
||||
|
||||
int32_t Func_least::getDateIntVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
int32_t str = fp[0]->data()->getDateIntVal(row, isNull);
|
||||
int32_t str = fp[0]->data()->getDateIntVal(row, isNull);
|
||||
|
||||
int32_t leastStr = str;
|
||||
for (uint32_t i = 1; i < fp.size(); i++)
|
||||
{
|
||||
int32_t str1 = fp[i]->data()->getDateIntVal(row, isNull);
|
||||
int32_t leastStr = str;
|
||||
|
||||
if ( leastStr > str1 )
|
||||
leastStr = str1;
|
||||
}
|
||||
for (uint32_t i = 1; i < fp.size(); i++)
|
||||
{
|
||||
int32_t str1 = fp[i]->data()->getDateIntVal(row, isNull);
|
||||
|
||||
return leastStr;
|
||||
if ( leastStr > str1 )
|
||||
leastStr = str1;
|
||||
}
|
||||
|
||||
return leastStr;
|
||||
}
|
||||
|
||||
int64_t Func_least::getDatetimeIntVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
int64_t str = fp[0]->data()->getDatetimeIntVal(row, isNull);
|
||||
int64_t str = fp[0]->data()->getDatetimeIntVal(row, isNull);
|
||||
|
||||
int64_t leastStr = str;
|
||||
for (uint32_t i = 1; i < fp.size(); i++)
|
||||
{
|
||||
int64_t str1 = fp[i]->data()->getDatetimeIntVal(row, isNull);
|
||||
int64_t leastStr = str;
|
||||
|
||||
if ( leastStr > str1 )
|
||||
leastStr = str1;
|
||||
}
|
||||
for (uint32_t i = 1; i < fp.size(); i++)
|
||||
{
|
||||
int64_t str1 = fp[i]->data()->getDatetimeIntVal(row, isNull);
|
||||
|
||||
return leastStr;
|
||||
if ( leastStr > str1 )
|
||||
leastStr = str1;
|
||||
}
|
||||
|
||||
return leastStr;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user