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

feat(runtime)!: MCOL-678 A "GROUP BY ... WITH ROLLUP" support

Adds a special column which helps to differentiate data and rollups of
various depts and a simple logic to row aggregation to add processing of
subtotals.
This commit is contained in:
Sergey Zefirov
2023-09-26 17:01:53 +03:00
committed by GitHub
parent 5013717730
commit 920607520c
20 changed files with 650 additions and 74 deletions

View File

@ -322,6 +322,8 @@ RGData::RGData(const RowGroup& rg, uint32_t rowCount)
memset(rowData.get(), 0, rg.getDataSize(rowCount)); // XXXPAT: make valgrind happy temporarily
#endif
memset(rowData.get(), 0, rg.getDataSize(rowCount)); // XXXPAT: make valgrind happy temporarily
columnCount = rg.getColumnCount();
rowSize = rg.getRowSize();
}
RGData::RGData(const RowGroup& rg)
@ -341,6 +343,8 @@ RGData::RGData(const RowGroup& rg)
*/
memset(rowData.get(), 0, rg.getMaxDataSize());
#endif
columnCount = rg.getColumnCount();
rowSize = rg.getRowSize();
}
void RGData::reinit(const RowGroup& rg, uint32_t rowCount)
@ -360,6 +364,8 @@ void RGData::reinit(const RowGroup& rg, uint32_t rowCount)
*/
memset(rowData.get(), 0, rg.getDataSize(rowCount));
#endif
columnCount = rg.getColumnCount();
rowSize = rg.getRowSize();
}
void RGData::reinit(const RowGroup& rg)
@ -372,6 +378,8 @@ void RGData::serialize(ByteStream& bs, uint32_t amount) const
// cout << "serializing!\n";
bs << (uint32_t)RGDATA_SIG;
bs << (uint32_t)amount;
bs << columnCount;
bs << rowSize;
bs.append(rowData.get(), amount);
if (strings)
@ -402,6 +410,14 @@ void RGData::deserialize(ByteStream& bs, uint32_t defAmount)
{
bs >> sig;
bs >> amount;
uint32_t colCountTemp;
uint32_t rowSizeTemp;
bs >> colCountTemp;
bs >> rowSizeTemp;
if (rowSize != 0)
{
idbassert(colCountTemp == columnCount && rowSize == rowSizeTemp);
}
rowData.reset(new uint8_t[std::max(amount, defAmount)]);
buf = bs.buf();
memcpy(rowData.get(), buf, amount);