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

MCOL-265 Add support for TIMESTAMP data type

This commit is contained in:
Gagan Goel
2019-03-17 14:14:03 -04:00
parent 8a7ccd7d93
commit e89d1ac3cf
167 changed files with 4346 additions and 250 deletions

View File

@ -50,7 +50,8 @@ namespace
inline bool getBool(rowgroup::Row& row,
funcexp::FunctionParm& pm,
bool& isNull,
CalpontSystemCatalog::ColType& ct)
CalpontSystemCatalog::ColType& ct,
const string& timeZone)
{
string expr;
@ -94,6 +95,14 @@ inline bool getBool(rowgroup::Row& row,
break;
}
case execplan::CalpontSystemCatalog::TIMESTAMP:
{
expr = dataconvert::DataConvert::timestampToString(pm[0]->data()->getTimestampIntVal(row, isNull), timeZone);
//strip off micro seconds
expr = expr.substr(0, 19);
break;
}
case execplan::CalpontSystemCatalog::TIME:
{
expr = dataconvert::DataConvert::timeToString(pm[0]->data()->getTimeIntVal(row, isNull));
@ -161,6 +170,14 @@ inline bool getBool(rowgroup::Row& row,
break;
}
case execplan::CalpontSystemCatalog::TIMESTAMP:
{
pattern = dataconvert::DataConvert::timestampToString(pm[1]->data()->getTimestampIntVal(row, isNull), timeZone);
//strip off micro seconds
pattern = pattern.substr(0, 19);
break;
}
case execplan::CalpontSystemCatalog::TIME:
{
pattern = dataconvert::DataConvert::timeToString(pm[1]->data()->getTimeIntVal(row, isNull));
@ -227,7 +244,7 @@ bool Func_regexp::getBoolVal(rowgroup::Row& row,
bool& isNull,
CalpontSystemCatalog::ColType& ct)
{
return getBool(row, pm, isNull, ct) && !isNull;
return getBool(row, pm, isNull, ct, fTimeZone) && !isNull;
}