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

MCOL-641 Simple aggregates works with GROUP BY column keys.

Fixed constant colump copy for binary columns in TNS.
This commit is contained in:
Roman Nozdrin
2020-05-08 15:57:23 +00:00
parent e88cbe9bc1
commit 21a41738e1
4 changed files with 45 additions and 22 deletions

View File

@ -1298,7 +1298,7 @@ void RowAggregation::doMinMax(const Row& rowIn, int64_t colIn, int64_t colOut, i
case execplan::CalpontSystemCatalog::DECIMAL:
case execplan::CalpontSystemCatalog::UDECIMAL:
{
if (LIKELY(fRow.getColumnWidth(colIn) == datatypes::MAXDECIMALWIDTH))
if (LIKELY(rowIn.getColumnWidth(colIn) == datatypes::MAXDECIMALWIDTH))
{
updateIntMinMax(rowIn.getBinaryField<int128_t>(colIn),
fRow.getBinaryField<int128_t>(colOut),

View File

@ -1203,19 +1203,32 @@ inline void Row::copyField(Row& out, uint32_t destIndex, uint32_t srcIndex) cons
if (UNLIKELY(types[srcIndex] == execplan::CalpontSystemCatalog::VARBINARY ||
types[srcIndex] == execplan::CalpontSystemCatalog::BLOB ||
types[srcIndex] == execplan::CalpontSystemCatalog::TEXT))
{
out.setVarBinaryField(getVarBinaryStringField(srcIndex), destIndex);
}
else if (UNLIKELY(isLongString(srcIndex)))
{
out.setStringField(getStringPointer(srcIndex), getStringLength(srcIndex), destIndex);
//out.setStringField(getStringField(srcIndex), destIndex);
}
else if (UNLIKELY(isShortString(srcIndex)))
{
out.setUintField(getUintField(srcIndex), destIndex);
}
else if (UNLIKELY(types[srcIndex] == execplan::CalpontSystemCatalog::LONGDOUBLE))
{
out.setLongDoubleField(getLongDoubleField(srcIndex), destIndex);
}
else if (UNLIKELY(datatypes::Decimal::isWideDecimalType(
types[srcIndex], colWidths[srcIndex])))
{
copyBinaryField(out, destIndex, srcIndex);
}
else
{
out.setIntField(getIntField(srcIndex), destIndex);
}
}
// WIP MCOL-641
inline void Row::copyBinaryField(Row& out, uint32_t destIndex, uint32_t srcIndex) const
{
out.setBinaryField(getBinaryField<int128_t>(srcIndex), 16, destIndex);
@ -1922,20 +1935,30 @@ inline void copyRow(const Row& in, Row* out, uint32_t colCount)
in.getColTypes()[i] == execplan::CalpontSystemCatalog::BLOB ||
in.getColTypes()[i] == execplan::CalpontSystemCatalog::TEXT ||
in.getColTypes()[i] == execplan::CalpontSystemCatalog::CLOB))
{
out->setVarBinaryField(in.getVarBinaryStringField(i), i);
}
else if (UNLIKELY(in.isLongString(i)))
//out->setStringField(in.getStringField(i), i);
{
out->setStringField(in.getStringPointer(i), in.getStringLength(i), i);
}
else if (UNLIKELY(in.isShortString(i)))
{
out->setUintField(in.getUintField(i), i);
}
else if (UNLIKELY(in.getColTypes()[i] == execplan::CalpontSystemCatalog::LONGDOUBLE))
{
out->setLongDoubleField(in.getLongDoubleField(i), i);
else if (UNLIKELY((in.getColType(i) == execplan::CalpontSystemCatalog::DECIMAL ||
in.getColType(i) == execplan::CalpontSystemCatalog::UDECIMAL) &&
in.getColumnWidth(i) == datatypes::MAXDECIMALWIDTH))
}
else if (UNLIKELY(datatypes::Decimal::isWideDecimalType(
in.getColType(i), in.getColumnWidth(i))))
{
in.copyBinaryField(*out, i, i);
}
else
{
out->setIntField(in.getIntField(i), i);
}
}
}