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
MCOL-392 Add initial TIME datatype support
This commit is contained in:
@ -902,7 +902,8 @@ void BulkLoadBuffer::convert(char* field, int fieldLength,
|
||||
{
|
||||
bool bSatVal = false;
|
||||
|
||||
if ( column.dataType != CalpontSystemCatalog::DATETIME )
|
||||
if ( column.dataType != CalpontSystemCatalog::DATETIME &&
|
||||
column.dataType != CalpontSystemCatalog::TIME )
|
||||
{
|
||||
if (nullFlag)
|
||||
{
|
||||
@ -976,6 +977,59 @@ void BulkLoadBuffer::convert(char* field, int fieldLength,
|
||||
|
||||
pVal = &llVal;
|
||||
}
|
||||
else if (column.dataType == CalpontSystemCatalog::TIME)
|
||||
{
|
||||
// time conversion
|
||||
int rc = 0;
|
||||
|
||||
if (nullFlag)
|
||||
{
|
||||
if (column.fWithDefault)
|
||||
{
|
||||
llDate = column.fDefaultInt;
|
||||
// fall through to update saturation and min/max
|
||||
}
|
||||
else
|
||||
{
|
||||
llDate = joblist::TIMENULL;
|
||||
pVal = &llDate;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fImportDataMode != IMPORT_DATA_TEXT)
|
||||
{
|
||||
memcpy(&llDate, field, sizeof(llDate));
|
||||
|
||||
if (!dataconvert::DataConvert::isColumnTimeValid(
|
||||
llDate))
|
||||
rc = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
llDate = dataconvert::DataConvert::convertColumnTime(
|
||||
field, dataconvert::CALPONTTIME_ENUM,
|
||||
rc, fieldLength );
|
||||
}
|
||||
}
|
||||
|
||||
if (rc == 0)
|
||||
{
|
||||
if (llDate < bufStats.minBufferVal)
|
||||
bufStats.minBufferVal = llDate;
|
||||
|
||||
if (llDate > bufStats.maxBufferVal)
|
||||
bufStats.maxBufferVal = llDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
llDate = 0;
|
||||
bufStats.satCount++;
|
||||
}
|
||||
|
||||
pVal = &llDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
// datetime conversion
|
||||
@ -2973,6 +3027,11 @@ bool BulkLoadBuffer::isBinaryFieldNull(void* val,
|
||||
if ((*(uint64_t*)val) == joblist::DATETIMENULL)
|
||||
isNullFlag = true;
|
||||
}
|
||||
else if (dt == execplan::CalpontSystemCatalog::TIME)
|
||||
{
|
||||
if ((*(uint64_t*)val) == joblist::TIMENULL)
|
||||
isNullFlag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((*(uint64_t*)val) == joblist::BIGINTNULL)
|
||||
|
Reference in New Issue
Block a user