You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
MCOL-5491 Enable StringStore for long strings in JSON_ARRAYAGG processing.
This patch is the JSON_ARRAYAGG clone of the changes done in MCOL-5429 where we enabled usage of StringStore for long strings in GROUP_CONCAT() processing to reduce memory footprint of PrimProc and thus avoiding a potential OS triggered OOM crash.
This commit is contained in:
@ -260,6 +260,14 @@ void JsonArrayInfo::mapColumns(const RowGroup& projRG)
|
||||
|
||||
(*k)->fRowGroup = RowGroup(oids.size(), pos, oids, keys, types, csNums, scale, precision,
|
||||
projRG.getStringTableThreshold(), false);
|
||||
|
||||
// MCOL-5491/MCOL-5429 Use stringstore if the datatype of the
|
||||
// json_arrayagg/group_concat field is a long string.
|
||||
if ((*k)->fRowGroup.hasLongString())
|
||||
{
|
||||
(*k)->fRowGroup.setUseStringTable(true);
|
||||
}
|
||||
|
||||
(*k)->fMapping = makeMapping(projRG, (*k)->fRowGroup);
|
||||
}
|
||||
}
|
||||
@ -311,9 +319,24 @@ void JsonArrayAggregatAgUM::initialize()
|
||||
|
||||
fConcator->initialize(fGroupConcat);
|
||||
|
||||
fGroupConcat->fRowGroup.initRow(&fRow, true);
|
||||
fData.reset(new uint8_t[fRow.getSize()]);
|
||||
fRow.setData(rowgroup::Row::Pointer(fData.get()));
|
||||
// MCOL-5491/MCOL-5429 Use stringstore if the datatype of the
|
||||
// json_arrayagg/group_concat field is a long string.
|
||||
if (fGroupConcat->fRowGroup.hasLongString())
|
||||
{
|
||||
fRowGroup = fGroupConcat->fRowGroup;
|
||||
fRowGroup.setUseStringTable(true);
|
||||
fRowRGData.reinit(fRowGroup, 1);
|
||||
fRowGroup.setData(&fRowRGData);
|
||||
fRowGroup.resetRowGroup(0);
|
||||
fRowGroup.initRow(&fRow);
|
||||
fRowGroup.getRow(0, &fRow);
|
||||
}
|
||||
else
|
||||
{
|
||||
fGroupConcat->fRowGroup.initRow(&fRow, true);
|
||||
fData.reset(new uint8_t[fRow.getSize()]);
|
||||
fRow.setData(rowgroup::Row::Pointer(fData.get()));
|
||||
}
|
||||
}
|
||||
|
||||
void JsonArrayAggregatAgUM::processRow(const rowgroup::Row& inRow)
|
||||
|
Reference in New Issue
Block a user