1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

Lot of files updated

This commit is contained in:
Nedeljko Stefanovic
2025-07-11 12:09:55 +00:00
parent 5e8c95a27e
commit c471862a85
28 changed files with 45 additions and 3 deletions

View File

@ -1573,6 +1573,7 @@ boost::any TypeHandlerEnum::convertFromString(const SystemCatalog::TypeAttribute
} }
} }
// Nedeljko TO DO
boost::any value = val; boost::any value = val;
return value; return value;

View File

@ -463,7 +463,7 @@ bool DDLIndexPopulator::checkNotNull(const IdxTuple& data, const CalpontSystemCa
case execplan::CalpontSystemCatalog::ENUM: case execplan::CalpontSystemCatalog::ENUM:
isNull = (any_cast<unsigned>(data.data) == any_cast<unsigned>(nullvalue)) || isNull = (any_cast<unsigned>(data.data) == any_cast<unsigned>(nullvalue)) ||
(any_cast<unsigned>(data.data)==colType.enumVals.size()); (any_cast<unsigned>(data.data)==USMALLINTNULL);
break; break;
case execplan::CalpontSystemCatalog::TINYINT: case execplan::CalpontSystemCatalog::TINYINT:

View File

@ -488,6 +488,7 @@ void AggregateColumn::evaluate(Row& row, bool& isNull)
break; break;
case CalpontSystemCatalog::ENUM: case CalpontSystemCatalog::ENUM:
// Nedeljko TO DO
if ((row.equals<2>(USMALLINTNULL, fInputIndex)) || (row.getUintField<2>(fInputIndex) == USMALLINTNULL)) if ((row.equals<2>(USMALLINTNULL, fInputIndex)) || (row.getUintField<2>(fInputIndex) == USMALLINTNULL))
isNull = true; isNull = true;
else else

View File

@ -1172,6 +1172,8 @@ inline bool isNull(int64_t val, const execplan::CalpontSystemCatalog::ColType& c
break; break;
} }
// Nedeljko TO DO
case execplan::CalpontSystemCatalog::ENUM:
case execplan::CalpontSystemCatalog::USMALLINT: case execplan::CalpontSystemCatalog::USMALLINT:
{ {
if (joblist::USMALLINTNULL == (uint16_t)val) if (joblist::USMALLINTNULL == (uint16_t)val)

View File

@ -476,7 +476,8 @@ inline const utils::NullString& TreeNode::getStrVal(const long timeZone)
{ {
case CalpontSystemCatalog::ENUM: case CalpontSystemCatalog::ENUM:
if (fResult.uintVal<fResultType.enumVals.size()) { // Nedeljko TO DO
if (fResult.uintVal==joblist::USMALLINTNULL) {
fResult.strVal.assign(fResultType.enumVals[fResult.uintVal]); fResult.strVal.assign(fResultType.enumVals[fResult.uintVal]);
} else { } else {
fResult.strVal.dropString(); fResult.strVal.dropString();

View File

@ -610,6 +610,7 @@ void WindowFunctionColumn::evaluate(Row& row, bool& isNull)
break; break;
} }
// Nedeljko TO DO
case CalpontSystemCatalog::ENUM: case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::USMALLINT: case CalpontSystemCatalog::USMALLINT:
{ {

View File

@ -492,6 +492,7 @@ void GroupConcator::outputRow(std::ostringstream& oss, const rowgroup::Row& row)
switch (types[*i]) switch (types[*i])
{ {
// Nedeljko TO DO
case CalpontSystemCatalog::TINYINT: case CalpontSystemCatalog::TINYINT:
case CalpontSystemCatalog::SMALLINT: case CalpontSystemCatalog::SMALLINT:
case CalpontSystemCatalog::MEDINT: case CalpontSystemCatalog::MEDINT:
@ -733,6 +734,7 @@ int64_t GroupConcator::lengthEstimate(const rowgroup::Row& row)
switch (types[*i]) switch (types[*i])
{ {
// Nedeljko TO DO
case CalpontSystemCatalog::TINYINT: case CalpontSystemCatalog::TINYINT:
case CalpontSystemCatalog::SMALLINT: case CalpontSystemCatalog::SMALLINT:
case CalpontSystemCatalog::MEDINT: case CalpontSystemCatalog::MEDINT:

View File

@ -728,6 +728,7 @@ bool compatibleColumnTypes(const CalpontSystemCatalog::ColDataType& dt1, uint32_
switch (dt1) switch (dt1)
{ {
// Nedeljko TO DO
case CalpontSystemCatalog::BIT: case CalpontSystemCatalog::BIT:
if (dt2 != CalpontSystemCatalog::BIT) if (dt2 != CalpontSystemCatalog::BIT)
return false; return false;

View File

@ -150,6 +150,7 @@ void valueNullNum(const CalpontSystemCatalog::ColType& ct, const long timeZone,
case CalpontSystemCatalog::SMALLINT: n = boost::any_cast<short>(anyVal); break; case CalpontSystemCatalog::SMALLINT: n = boost::any_cast<short>(anyVal); break;
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::USMALLINT: n = boost::any_cast<uint16_t>(anyVal); break; case CalpontSystemCatalog::USMALLINT: n = boost::any_cast<uint16_t>(anyVal); break;
case CalpontSystemCatalog::MEDINT: case CalpontSystemCatalog::MEDINT:
@ -346,6 +347,7 @@ void convertValueNum(const string& str, const CalpontSystemCatalog::ColType& ct,
} }
break; break;
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::CHAR: case CalpontSystemCatalog::CHAR:
case CalpontSystemCatalog::VARCHAR: case CalpontSystemCatalog::VARCHAR:
case CalpontSystemCatalog::VARBINARY: case CalpontSystemCatalog::VARBINARY:
@ -1723,6 +1725,7 @@ const JobStepVector doSimpleFilter(SimpleFilter* sf, JobInfo& jobInfo)
{ {
switch (ct.colDataType) switch (ct.colDataType)
{ {
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::TINYINT: case CalpontSystemCatalog::TINYINT:
case CalpontSystemCatalog::SMALLINT: case CalpontSystemCatalog::SMALLINT:
case CalpontSystemCatalog::MEDINT: case CalpontSystemCatalog::MEDINT:

View File

@ -106,6 +106,7 @@ void getColumnValue(ConstantColumn** cc, uint64_t i, const Row& row, const long
} }
break; break;
// Nedeljko TO DO
case CalpontSystemCatalog::UTINYINT: case CalpontSystemCatalog::UTINYINT:
case CalpontSystemCatalog::USMALLINT: case CalpontSystemCatalog::USMALLINT:
case CalpontSystemCatalog::UMEDINT: case CalpontSystemCatalog::UMEDINT:

View File

@ -531,6 +531,7 @@ bool LBIDList::CasualPartitionDataType(const CalpontSystemCatalog::ColDataType t
case CalpontSystemCatalog::BLOB: case CalpontSystemCatalog::BLOB:
case CalpontSystemCatalog::TEXT: return size <= 8; case CalpontSystemCatalog::TEXT: return size <= 8;
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::TINYINT: case CalpontSystemCatalog::TINYINT:
case CalpontSystemCatalog::SMALLINT: case CalpontSystemCatalog::SMALLINT:
case CalpontSystemCatalog::MEDINT: case CalpontSystemCatalog::MEDINT:

View File

@ -321,6 +321,7 @@ bool pColScanStep::isEmptyVal(const uint8_t* val8) const
return (*val8 == joblist::UTINYINTEMPTYROW); return (*val8 == joblist::UTINYINTEMPTYROW);
} }
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::USMALLINT: case CalpontSystemCatalog::USMALLINT:
{ {
const uint16_t* val16 = reinterpret_cast<const uint16_t*>(val8); const uint16_t* val16 = reinterpret_cast<const uint16_t*>(val8);

View File

@ -136,6 +136,8 @@ uint32_t RowEstimator::estimateDistinctValues(const execplan::CalpontSystemCatal
{ {
case CalpontSystemCatalog::BIT: return 2; case CalpontSystemCatalog::BIT: return 2;
case CalpontSystemCatalog::ENUM: return ct.enumVals.size();
// Return limit/2 for integers where limit is number of possible values. // Return limit/2 for integers where limit is number of possible values.
case CalpontSystemCatalog::TINYINT: return (1 << 8) / 2; case CalpontSystemCatalog::TINYINT: return (1 << 8) / 2;

View File

@ -152,6 +152,8 @@ inline string colTypeIdString(CalpontSystemCatalog::ColDataType type)
{ {
case CalpontSystemCatalog::BIT: return string("BIT"); case CalpontSystemCatalog::BIT: return string("BIT");
case CalpontSystemCatalog::ENUM: return string("ENUM");
case CalpontSystemCatalog::TINYINT: return string("TINYINT"); case CalpontSystemCatalog::TINYINT: return string("TINYINT");
case CalpontSystemCatalog::CHAR: return string("CHAR"); case CalpontSystemCatalog::CHAR: return string("CHAR");

View File

@ -736,6 +736,7 @@ namespace
break; break;
} }
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::UTINYINT: case CalpontSystemCatalog::UTINYINT:
case CalpontSystemCatalog::USMALLINT: case CalpontSystemCatalog::USMALLINT:
case CalpontSystemCatalog::UMEDINT: case CalpontSystemCatalog::UMEDINT:
@ -810,6 +811,7 @@ namespace
break; break;
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::UTINYINT: case CalpontSystemCatalog::UTINYINT:
case CalpontSystemCatalog::USMALLINT: case CalpontSystemCatalog::USMALLINT:
case CalpontSystemCatalog::UMEDINT: case CalpontSystemCatalog::UMEDINT:
@ -835,6 +837,7 @@ namespace
break; break;
} }
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::UTINYINT: case CalpontSystemCatalog::UTINYINT:
case CalpontSystemCatalog::USMALLINT: case CalpontSystemCatalog::USMALLINT:
case CalpontSystemCatalog::UMEDINT: case CalpontSystemCatalog::UMEDINT:
@ -1042,6 +1045,7 @@ namespace
break; break;
} }
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::UTINYINT: case CalpontSystemCatalog::UTINYINT:
case CalpontSystemCatalog::USMALLINT: case CalpontSystemCatalog::USMALLINT:
case CalpontSystemCatalog::UMEDINT: case CalpontSystemCatalog::UMEDINT:
@ -1759,6 +1763,8 @@ void TupleUnion::writeNull(Row* out, uint32_t col)
case CalpontSystemCatalog::UTINYINT: out->setUintField<1>(joblist::UTINYINTNULL, col); break; case CalpontSystemCatalog::UTINYINT: out->setUintField<1>(joblist::UTINYINTNULL, col); break;
case CalpontSystemCatalog::ENUM: out->setUintField<1>(joblist::USMALLINTNULL, col); break;
case CalpontSystemCatalog::USMALLINT: out->setUintField<1>(joblist::USMALLINTNULL, col); break; case CalpontSystemCatalog::USMALLINT: out->setUintField<1>(joblist::USMALLINTNULL, col); break;
case CalpontSystemCatalog::DECIMAL: case CalpontSystemCatalog::DECIMAL:

View File

@ -1193,6 +1193,7 @@ boost::shared_ptr<FrameBound> WindowFunctionStep::parseFrameBoundRows(const exec
break; break;
} }
case execplan::CalpontSystemCatalog::ENUM:
case execplan::CalpontSystemCatalog::UTINYINT: case execplan::CalpontSystemCatalog::UTINYINT:
case execplan::CalpontSystemCatalog::USMALLINT: case execplan::CalpontSystemCatalog::USMALLINT:
case execplan::CalpontSystemCatalog::UMEDINT: case execplan::CalpontSystemCatalog::UMEDINT:
@ -1344,6 +1345,7 @@ boost::shared_ptr<FrameBound> WindowFunctionStep::parseFrameBoundRange(const exe
break; break;
} }
// Nedeljko TO DO
case execplan::CalpontSystemCatalog::UTINYINT: case execplan::CalpontSystemCatalog::UTINYINT:
case execplan::CalpontSystemCatalog::USMALLINT: case execplan::CalpontSystemCatalog::USMALLINT:
case execplan::CalpontSystemCatalog::UMEDINT: case execplan::CalpontSystemCatalog::UMEDINT:

View File

@ -257,6 +257,7 @@ inline bool isMinMaxValid(const NewColRequestHeader* in)
case CalpontSystemCatalog::BLOB: case CalpontSystemCatalog::BLOB:
case CalpontSystemCatalog::TEXT: return (in->colType.DataSize < 8); case CalpontSystemCatalog::TEXT: return (in->colType.DataSize < 8);
// Nedeljko TO DO
case CalpontSystemCatalog::TINYINT: case CalpontSystemCatalog::TINYINT:
case CalpontSystemCatalog::SMALLINT: case CalpontSystemCatalog::SMALLINT:
case CalpontSystemCatalog::MEDINT: case CalpontSystemCatalog::MEDINT:
@ -495,6 +496,7 @@ T getEmptyValue(uint8_t type)
case CalpontSystemCatalog::TIMESTAMP: case CalpontSystemCatalog::TIMESTAMP:
case CalpontSystemCatalog::TIME: return joblist::CHAR2EMPTYROW; case CalpontSystemCatalog::TIME: return joblist::CHAR2EMPTYROW;
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::USMALLINT: return joblist::USMALLINTEMPTYROW; case CalpontSystemCatalog::USMALLINT: return joblist::USMALLINTEMPTYROW;
default: return joblist::SMALLINTEMPTYROW; default: return joblist::SMALLINTEMPTYROW;

View File

@ -104,6 +104,7 @@ int64_t Func_date::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNul
break; break;
} }
case execplan::CalpontSystemCatalog::ENUM:
case execplan::CalpontSystemCatalog::BIGINT: case execplan::CalpontSystemCatalog::BIGINT:
case execplan::CalpontSystemCatalog::INT: case execplan::CalpontSystemCatalog::INT:
case execplan::CalpontSystemCatalog::MEDINT: case execplan::CalpontSystemCatalog::MEDINT:

View File

@ -139,6 +139,7 @@ inline uint64_t simple_case_cmp(Row& row, FunctionParm& parm, bool& isNull,
break; break;
} }
case execplan::CalpontSystemCatalog::ENUM:
case execplan::CalpontSystemCatalog::UBIGINT: case execplan::CalpontSystemCatalog::UBIGINT:
case execplan::CalpontSystemCatalog::UINT: case execplan::CalpontSystemCatalog::UINT:
case execplan::CalpontSystemCatalog::UMEDINT: case execplan::CalpontSystemCatalog::UMEDINT:

View File

@ -63,6 +63,7 @@ int64_t Func_floor::getIntVal(Row& row, FunctionParm& parm, bool& isNull,
} }
break; break;
case execplan::CalpontSystemCatalog::ENUM:
case execplan::CalpontSystemCatalog::UBIGINT: case execplan::CalpontSystemCatalog::UBIGINT:
case execplan::CalpontSystemCatalog::UINT: case execplan::CalpontSystemCatalog::UINT:
case execplan::CalpontSystemCatalog::UMEDINT: case execplan::CalpontSystemCatalog::UMEDINT:
@ -165,6 +166,7 @@ uint64_t Func_floor::getUintVal(Row& row, FunctionParm& parm, bool& isNull,
} }
break; break;
case execplan::CalpontSystemCatalog::ENUM:
case execplan::CalpontSystemCatalog::UBIGINT: case execplan::CalpontSystemCatalog::UBIGINT:
case execplan::CalpontSystemCatalog::UINT: case execplan::CalpontSystemCatalog::UINT:
case execplan::CalpontSystemCatalog::UMEDINT: case execplan::CalpontSystemCatalog::UMEDINT:

View File

@ -83,6 +83,7 @@ inline bool getBoolForIn(rowgroup::Row& row, funcexp::FunctionParm& pm, bool& is
return false; return false;
} }
case execplan::CalpontSystemCatalog::ENUM:
case execplan::CalpontSystemCatalog::UBIGINT: case execplan::CalpontSystemCatalog::UBIGINT:
case execplan::CalpontSystemCatalog::UINT: case execplan::CalpontSystemCatalog::UINT:
case execplan::CalpontSystemCatalog::UMEDINT: case execplan::CalpontSystemCatalog::UMEDINT:

View File

@ -175,6 +175,7 @@ inline uint64_t getUintNullValue(int colType, int colWidth = 0)
return joblist::UTINYINTNULL; return joblist::UTINYINTNULL;
} }
case execplan::CalpontSystemCatalog::ENUM:
case execplan::CalpontSystemCatalog::USMALLINT: case execplan::CalpontSystemCatalog::USMALLINT:
{ {
return joblist::USMALLINTNULL; return joblist::USMALLINTNULL;
@ -399,6 +400,7 @@ inline bool RowAggregation::isNull(const RowGroup* pRowGroup, const Row& row, in
break; break;
} }
case execplan::CalpontSystemCatalog::ENUM:
case execplan::CalpontSystemCatalog::USMALLINT: case execplan::CalpontSystemCatalog::USMALLINT:
{ {
ret = ((uint16_t)row.getIntField(col) == joblist::USMALLINTNULL); ret = ((uint16_t)row.getIntField(col) == joblist::USMALLINTNULL);

View File

@ -879,6 +879,7 @@ void Row::setToNull(uint32_t colIndex)
case CalpontSystemCatalog::UTINYINT: data[offsets[colIndex]] = joblist::UTINYINTNULL; break; case CalpontSystemCatalog::UTINYINT: data[offsets[colIndex]] = joblist::UTINYINTNULL; break;
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::USMALLINT: case CalpontSystemCatalog::USMALLINT:
*((uint16_t*)&data[offsets[colIndex]]) = joblist::USMALLINTNULL; *((uint16_t*)&data[offsets[colIndex]]) = joblist::USMALLINTNULL;
break; break;
@ -1047,6 +1048,7 @@ bool Row::isNullValue(uint32_t colIndex) const
case CalpontSystemCatalog::UTINYINT: return (data[offsets[colIndex]] == joblist::UTINYINTNULL); case CalpontSystemCatalog::UTINYINT: return (data[offsets[colIndex]] == joblist::UTINYINTNULL);
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::USMALLINT: case CalpontSystemCatalog::USMALLINT:
return (*((uint16_t*)&data[offsets[colIndex]]) == joblist::USMALLINTNULL); return (*((uint16_t*)&data[offsets[colIndex]]) == joblist::USMALLINTNULL);

View File

@ -81,6 +81,7 @@ int32_t mcsv1Context::getColWidth()
case execplan::CalpontSystemCatalog::UTINYINT: case execplan::CalpontSystemCatalog::UTINYINT:
case execplan::CalpontSystemCatalog::CHAR: fColWidth = 1; break; case execplan::CalpontSystemCatalog::CHAR: fColWidth = 1; break;
case execplan::CalpontSystemCatalog::ENUM:
case execplan::CalpontSystemCatalog::SMALLINT: case execplan::CalpontSystemCatalog::SMALLINT:
case execplan::CalpontSystemCatalog::USMALLINT: fColWidth = 2; break; case execplan::CalpontSystemCatalog::USMALLINT: fColWidth = 2; break;

View File

@ -66,6 +66,7 @@ boost::shared_ptr<WindowFunctionType> WF_lead_lag<T>::makeFunction(int id, const
break; break;
} }
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::UTINYINT: case CalpontSystemCatalog::UTINYINT:
case CalpontSystemCatalog::USMALLINT: case CalpontSystemCatalog::USMALLINT:
case CalpontSystemCatalog::UMEDINT: case CalpontSystemCatalog::UMEDINT:

View File

@ -57,6 +57,7 @@ boost::shared_ptr<WindowFunctionType> WF_min_max<T>::makeFunction(int id, const
break; break;
} }
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::UTINYINT: case CalpontSystemCatalog::UTINYINT:
case CalpontSystemCatalog::USMALLINT: case CalpontSystemCatalog::USMALLINT:
case CalpontSystemCatalog::UMEDINT: case CalpontSystemCatalog::UMEDINT:

View File

@ -62,6 +62,7 @@ boost::shared_ptr<WindowFunctionType> WF_stats<T>::makeFunction(int id, const st
break; break;
} }
case CalpontSystemCatalog::ENUM:
case CalpontSystemCatalog::UTINYINT: case CalpontSystemCatalog::UTINYINT:
case CalpontSystemCatalog::USMALLINT: case CalpontSystemCatalog::USMALLINT:
case CalpontSystemCatalog::UMEDINT: case CalpontSystemCatalog::UMEDINT: