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
MCOL-641 1. Add support for int128_t in ParsedColumnFilter.
2. Set Decimal precision in SimpleColumn::evaluate(). 3. Add support for int128_t in ConstantColumn. 4. Set IDB_Decimal::s128Value in buildDecimalColumn(). 5. Use width 16 as first if predicate for branching based on decimal width.
This commit is contained in:
committed by
Roman Nozdrin
parent
0bd172cd6e
commit
74b64eb4f1
@ -230,6 +230,7 @@ ConstantColumn::ConstantColumn(const int64_t val, TYPE type) :
|
||||
fResult.doubleVal = (double)fResult.intVal;
|
||||
fResult.longDoubleVal = (long double)fResult.intVal;
|
||||
fResult.decimalVal.value = fResult.intVal;
|
||||
fResult.decimalVal.s128Value = fResult.intVal;
|
||||
fResult.decimalVal.scale = 0;
|
||||
fResultType.colDataType = CalpontSystemCatalog::BIGINT;
|
||||
fResultType.colWidth = 8;
|
||||
@ -250,6 +251,7 @@ ConstantColumn::ConstantColumn(const uint64_t val, TYPE type) :
|
||||
fResult.doubleVal = (double)fResult.uintVal;
|
||||
fResult.longDoubleVal = (long double)fResult.uintVal;
|
||||
fResult.decimalVal.value = fResult.uintVal;
|
||||
fResult.decimalVal.s128Value = fResult.uintVal;
|
||||
fResult.decimalVal.scale = 0;
|
||||
fResultType.colDataType = CalpontSystemCatalog::UBIGINT;
|
||||
fResultType.colWidth = 8;
|
||||
@ -317,6 +319,7 @@ void ConstantColumn::serialize(messageqcpp::ByteStream& b) const
|
||||
b << (uint8_t)fResult.boolVal;
|
||||
b << fResult.strVal;
|
||||
b << (uint64_t)fResult.decimalVal.value;
|
||||
b << (uint128_t)fResult.decimalVal.s128Value;
|
||||
b << (uint8_t)fResult.decimalVal.scale;
|
||||
b << (uint8_t)fResult.decimalVal.precision;
|
||||
}
|
||||
@ -341,6 +344,7 @@ void ConstantColumn::unserialize(messageqcpp::ByteStream& b)
|
||||
b >> (uint8_t&)fResult.boolVal;
|
||||
b >> fResult.strVal;
|
||||
b >> (uint64_t&)fResult.decimalVal.value;
|
||||
b >> (uint128_t&)fResult.decimalVal.s128Value;
|
||||
b >> (uint8_t&)fResult.decimalVal.scale;
|
||||
b >> (uint8_t&)fResult.decimalVal.precision;
|
||||
}
|
||||
|
@ -637,38 +637,36 @@ void SimpleColumn::evaluate(Row& row, bool& isNull)
|
||||
{
|
||||
fResult.decimalVal.s128Value =
|
||||
*row.getBinaryField_offset<decltype(fResult.decimalVal.s128Value)>(fInputOffset);
|
||||
fResult.decimalVal.scale = (unsigned)fResultType.scale;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
fResult.decimalVal.value = row.getIntField<1>(fInputIndex);
|
||||
fResult.decimalVal.scale = (unsigned)fResultType.scale;
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
fResult.decimalVal.value = row.getIntField<2>(fInputIndex);
|
||||
fResult.decimalVal.scale = (unsigned)fResultType.scale;
|
||||
break;
|
||||
}
|
||||
|
||||
case 4:
|
||||
{
|
||||
fResult.decimalVal.value = row.getIntField<4>(fInputIndex);
|
||||
fResult.decimalVal.scale = (unsigned)fResultType.scale;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
fResult.decimalVal.value = (int64_t)row.getUintField<8>(fInputIndex);
|
||||
fResult.decimalVal.scale = (unsigned)fResultType.scale;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fResult.decimalVal.scale = (unsigned)fResultType.scale;
|
||||
fResult.decimalVal.precision = (unsigned)fResultType.precision;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,7 @@ struct IDB_Decimal
|
||||
{
|
||||
s128Value = 0;
|
||||
}
|
||||
|
||||
IDB_Decimal(int64_t val, int8_t s, uint8_t p) :
|
||||
value (val),
|
||||
scale(s),
|
||||
@ -131,6 +132,7 @@ struct IDB_Decimal
|
||||
return (decimalComp(rhs) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
bool operator>(const IDB_Decimal& rhs) const
|
||||
{
|
||||
if (utils::widthByPrecision(precision) == 16)
|
||||
@ -148,6 +150,7 @@ struct IDB_Decimal
|
||||
return (decimalComp(rhs) > 0);
|
||||
}
|
||||
}
|
||||
|
||||
bool operator<(const IDB_Decimal& rhs) const
|
||||
{
|
||||
if (utils::widthByPrecision(precision) == 16)
|
||||
@ -165,6 +168,7 @@ struct IDB_Decimal
|
||||
return (decimalComp(rhs) < 0);
|
||||
}
|
||||
}
|
||||
|
||||
bool operator>=(const IDB_Decimal& rhs) const
|
||||
{
|
||||
if (utils::widthByPrecision(precision) == 16)
|
||||
@ -182,6 +186,7 @@ struct IDB_Decimal
|
||||
return (decimalComp(rhs) >= 0);
|
||||
}
|
||||
}
|
||||
|
||||
bool operator<=(const IDB_Decimal& rhs) const
|
||||
{
|
||||
if (utils::widthByPrecision(precision) == 16)
|
||||
@ -199,6 +204,7 @@ struct IDB_Decimal
|
||||
return (decimalComp(rhs) <= 0);
|
||||
}
|
||||
}
|
||||
|
||||
bool operator!=(const IDB_Decimal& rhs) const
|
||||
{
|
||||
if (utils::widthByPrecision(precision) == 16)
|
||||
|
Reference in New Issue
Block a user