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:
@ -44,78 +44,78 @@ namespace funcexp
|
||||
|
||||
CalpontSystemCatalog::ColType Func_date::operationType( FunctionParm& fp, CalpontSystemCatalog::ColType& resultType )
|
||||
{
|
||||
return resultType;
|
||||
return resultType;
|
||||
}
|
||||
|
||||
int64_t Func_date::getIntVal(rowgroup::Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType&)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType&)
|
||||
{
|
||||
CalpontSystemCatalog::ColDataType type = parm[0]->data()->resultType().colDataType;
|
||||
CalpontSystemCatalog::ColDataType type = parm[0]->data()->resultType().colDataType;
|
||||
|
||||
string value = "";
|
||||
string value = "";
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case execplan::CalpontSystemCatalog::DATE:
|
||||
{
|
||||
return parm[0]->data()->getDatetimeIntVal(row, isNull);
|
||||
break;
|
||||
}
|
||||
switch (type)
|
||||
{
|
||||
case execplan::CalpontSystemCatalog::DATE:
|
||||
{
|
||||
return parm[0]->data()->getDatetimeIntVal(row, isNull);
|
||||
break;
|
||||
}
|
||||
|
||||
case execplan::CalpontSystemCatalog::DATETIME:
|
||||
{
|
||||
int64_t val1 = parm[0]->data()->getDatetimeIntVal(row, isNull);
|
||||
value = dataconvert::DataConvert::datetimeToString(val1);
|
||||
value = value.substr(0,10);
|
||||
break;
|
||||
}
|
||||
case execplan::CalpontSystemCatalog::DATETIME:
|
||||
{
|
||||
int64_t val1 = parm[0]->data()->getDatetimeIntVal(row, isNull);
|
||||
value = dataconvert::DataConvert::datetimeToString(val1);
|
||||
value = value.substr(0, 10);
|
||||
break;
|
||||
}
|
||||
|
||||
case execplan::CalpontSystemCatalog::BIGINT:
|
||||
case execplan::CalpontSystemCatalog::INT:
|
||||
case execplan::CalpontSystemCatalog::MEDINT:
|
||||
case execplan::CalpontSystemCatalog::TINYINT:
|
||||
case execplan::CalpontSystemCatalog::SMALLINT:
|
||||
case execplan::CalpontSystemCatalog::BIGINT:
|
||||
case execplan::CalpontSystemCatalog::INT:
|
||||
case execplan::CalpontSystemCatalog::MEDINT:
|
||||
case execplan::CalpontSystemCatalog::TINYINT:
|
||||
case execplan::CalpontSystemCatalog::SMALLINT:
|
||||
case execplan::CalpontSystemCatalog::UBIGINT:
|
||||
case execplan::CalpontSystemCatalog::UINT:
|
||||
case execplan::CalpontSystemCatalog::UMEDINT:
|
||||
case execplan::CalpontSystemCatalog::UTINYINT:
|
||||
case execplan::CalpontSystemCatalog::USMALLINT:
|
||||
case execplan::CalpontSystemCatalog::DOUBLE:
|
||||
case execplan::CalpontSystemCatalog::UDOUBLE:
|
||||
case execplan::CalpontSystemCatalog::FLOAT:
|
||||
case execplan::CalpontSystemCatalog::UDOUBLE:
|
||||
case execplan::CalpontSystemCatalog::FLOAT:
|
||||
case execplan::CalpontSystemCatalog::UFLOAT:
|
||||
case execplan::CalpontSystemCatalog::VARCHAR:
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::TEXT:
|
||||
case execplan::CalpontSystemCatalog::DECIMAL:
|
||||
case execplan::CalpontSystemCatalog::VARCHAR:
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::TEXT:
|
||||
case execplan::CalpontSystemCatalog::DECIMAL:
|
||||
case execplan::CalpontSystemCatalog::UDECIMAL:
|
||||
{
|
||||
isNull = true;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
{
|
||||
isNull = true;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "date: datatype of " << execplan::colDataTypeToString(type);
|
||||
throw logging::IDBExcept(oss.str(), ERR_DATATYPE_NOT_SUPPORT);
|
||||
}
|
||||
}
|
||||
default:
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "date: datatype of " << execplan::colDataTypeToString(type);
|
||||
throw logging::IDBExcept(oss.str(), ERR_DATATYPE_NOT_SUPPORT);
|
||||
}
|
||||
}
|
||||
|
||||
return dataconvert::DataConvert::datetimeToInt(value);
|
||||
return dataconvert::DataConvert::datetimeToInt(value);
|
||||
}
|
||||
|
||||
string Func_date::getStrVal(rowgroup::Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType&)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType&)
|
||||
{
|
||||
const string& val = parm[0]->data()->getStrVal(row, isNull);
|
||||
const string& val = parm[0]->data()->getStrVal(row, isNull);
|
||||
|
||||
return val.substr(0,10);
|
||||
return val.substr(0, 10);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user