1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-07 03:22:57 +03:00

Update. The class Row has to be updated to contain ColType info abu columns instead of ColDataType.

This commit is contained in:
Nedeljko Stefanovic
2025-07-04 10:44:54 +00:00
parent 5a9eada4d7
commit 5e8c95a27e
9 changed files with 30 additions and 11 deletions

View File

@@ -1190,7 +1190,6 @@ class TypeHandlerEnum : public TypeHandler
}
boost::any getNullValueForType(const SystemCatalog::TypeAttributesStd& /*attr*/) const override
{
// TODO: How to communicate with write engine?
return {};
}
boost::any convertFromString(const SystemCatalog::TypeAttributesStd& /*colType*/,

View File

@@ -314,12 +314,7 @@ boost::any DDLIndexPopulator::convertData(const CalpontSystemCatalog::ColType& c
switch (colType.colDataType)
{
case CalpontSystemCatalog::BIT:
case CalpontSystemCatalog::ENUM:
{
string strData(colType.fEnumValues[data]);
return *reinterpret_cast<string*>(&strData);
}
case CalpontSystemCatalog::ENUM: return colType.fEnumValues[data];
case execplan::CalpontSystemCatalog::TINYINT: return *reinterpret_cast<char*>(&data);
case execplan::CalpontSystemCatalog::SMALLINT: return *reinterpret_cast<short*>(&data);
@@ -467,7 +462,8 @@ bool DDLIndexPopulator::checkNotNull(const IdxTuple& data, const CalpontSystemCa
case CalpontSystemCatalog::BIT: break;
case execplan::CalpontSystemCatalog::ENUM:
isNull = any_cast<short>(data.data) == any_cast<short>(nullvalue);
isNull = (any_cast<unsigned>(data.data) == any_cast<unsigned>(nullvalue)) ||
(any_cast<unsigned>(data.data)==colType.enumVals.size());
break;
case execplan::CalpontSystemCatalog::TINYINT:

View File

@@ -487,6 +487,14 @@ void AggregateColumn::evaluate(Row& row, bool& isNull)
break;
case CalpontSystemCatalog::ENUM:
if ((row.equals<2>(USMALLINTNULL, fInputIndex)) || (row.getUintField<2>(fInputIndex) == USMALLINTNULL))
isNull = true;
else
fResult.uintVal = row.getUintField<2>(fInputIndex);
break;
case CalpontSystemCatalog::TINYINT:
if (row.equals<1>(TINYINTNULL, fInputIndex))
isNull = true;

View File

@@ -289,6 +289,8 @@ inline void ArithmeticOperator::evaluate(rowgroup::Row& row, bool& isNull, Parse
fResult.uintVal = static_cast<uint64_t>(result);
}
break;
case execplan::CalpontSystemCatalog::ENUM:
case execplan::CalpontSystemCatalog::UINT:
case execplan::CalpontSystemCatalog::UMEDINT:
case execplan::CalpontSystemCatalog::USMALLINT:

View File

@@ -731,6 +731,7 @@ void SimpleColumn::evaluate(Row& row, bool& isNull)
break;
}
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::USMALLINT:
{
fResult.uintVal = row.getUintField<2>(fInputIndex);

View File

@@ -474,6 +474,16 @@ inline const utils::NullString& TreeNode::getStrVal(const long timeZone)
{
switch (fResultType.colDataType)
{
case CalpontSystemCatalog::ENUM:
if (fResult.uintVal<fResultType.enumVals.size()) {
fResult.strVal.assign(fResultType.enumVals[fResult.uintVal]);
} else {
fResult.strVal.dropString();
}
break;
case CalpontSystemCatalog::VARCHAR:
if (fResultType.colWidth <= 7)
{
@@ -713,6 +723,7 @@ inline int64_t TreeNode::getIntVal()
case CalpontSystemCatalog::MEDINT:
case CalpontSystemCatalog::INT: return fResult.intVal;
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::UBIGINT:
case CalpontSystemCatalog::UTINYINT:
case CalpontSystemCatalog::USMALLINT:
@@ -764,6 +775,7 @@ inline uint64_t TreeNode::getUintVal()
case CalpontSystemCatalog::MEDINT:
case CalpontSystemCatalog::INT: return fResult.intVal;
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::UBIGINT:
case CalpontSystemCatalog::UTINYINT:
case CalpontSystemCatalog::USMALLINT:

View File

@@ -610,6 +610,7 @@ void WindowFunctionColumn::evaluate(Row& row, bool& isNull)
break;
}
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::USMALLINT:
{
if (row.equals<2>(USMALLINTNULL, fInputIndex))

View File

@@ -250,6 +250,7 @@ T CrossEngineStep::convertValueNum(const char* str, const CalpontSystemCatalog::
case CalpontSystemCatalog::SMALLINT: rv = boost::any_cast<int16_t>(anyVal); break;
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::USMALLINT: rv = boost::any_cast<uint16_t>(anyVal); break;
case CalpontSystemCatalog::MEDINT:

View File

@@ -29,7 +29,6 @@
namespace joblist
{
const uint64_t ENUMNULL = 0xffff;
const uint64_t BIGINTNULL = 0x8000000000000000ULL;
const uint64_t BIGINTEMPTYROW = 0x8000000000000001ULL;
const uint32_t INTNULL = 0x80000000;