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

MCOL-5385 set data extermination [develop-23.02] (#2813)

* Delete RowGroup::setData and make Pointer ctor explicit

* some push_backs replaced with emplace_backs

* Fixes of review notes
This commit is contained in:
Leonid Fedorov
2023-04-16 15:57:39 +03:00
committed by GitHub
parent 2f153184c3
commit f1697c261e
13 changed files with 37 additions and 47 deletions

View File

@ -435,7 +435,7 @@ void CrossEngineStep::execute()
Row rowFe1; // row for fe evaluation
fRowGroupFe1.initRow(&rowFe1, true);
rgDataFe1.reset(new uint8_t[rowFe1.getSize()]);
rowFe1.setData(rgDataFe1.get());
rowFe1.setData(rowgroup::Row::Pointer(rgDataFe1.get()));
while ((rowIn = mysql->nextRow()) && !cancelled())
{
@ -486,7 +486,7 @@ void CrossEngineStep::execute()
Row rowFe3; // row for fe evaluation
fRowGroupOut.initRow(&rowFe3, true);
rgDataFe3.reset(new uint8_t[rowFe3.getSize()]);
rowFe3.setData(rgDataFe3.get());
rowFe3.setData(rowgroup::Row::Pointer(rgDataFe3.get()));
while ((rowIn = mysql->nextRow()) && !cancelled())
{
@ -507,13 +507,13 @@ void CrossEngineStep::execute()
Row rowFe1; // row for fe1 evaluation
fRowGroupFe1.initRow(&rowFe1, true);
rgDataFe1.reset(new uint8_t[rowFe1.getSize()]);
rowFe1.setData(rgDataFe1.get());
rowFe1.setData(rowgroup::Row::Pointer(rgDataFe1.get()));
shared_array<uint8_t> rgDataFe3; // functions in select clause
Row rowFe3; // row for fe3 evaluation
fRowGroupOut.initRow(&rowFe3, true);
rgDataFe3.reset(new uint8_t[rowFe3.getSize()]);
rowFe3.setData(rgDataFe3.get());
rowFe3.setData(rowgroup::Row::Pointer(rgDataFe3.get()));
while ((rowIn = mysql->nextRow()) && !cancelled())
{

View File

@ -372,7 +372,7 @@ void DiskJoinStep::joinFcn()
{
joinFERG.initRow(&l_joinFERow, true);
joinFEMem.reset(new uint8_t[l_joinFERow.getSize()]);
l_joinFERow.setData(joinFEMem.get());
l_joinFERow.setData(rowgroup::Row::Pointer(joinFEMem.get()));
}
outputRG.initRow(&l_outputRow);
@ -381,8 +381,8 @@ void DiskJoinStep::joinFcn()
largeRG.initRow(&l_largeRow);
baseRowMem.reset(new uint8_t[baseRow.getSize()]);
baseRow.setData(baseRowMem.get());
joinMatches.push_back(vector<Row::Pointer>());
baseRow.setData(rowgroup::Row::Pointer(baseRowMem.get()));
joinMatches.emplace_back(vector<Row::Pointer>());
smallRG.initRow(&smallRowTemplates[0]);
joiners.resize(1);
@ -400,7 +400,7 @@ void DiskJoinStep::joinFcn()
l_smallRG.initRow(&smallNullRow, true);
smallNullMem.reset(new boost::scoped_array<uint8_t>[1]);
smallNullMem[0].reset(new uint8_t[smallNullRow.getSize()]);
smallNullRow.setData(smallNullMem[0].get());
smallNullRow.setData(rowgroup::Row::Pointer(smallNullMem[0].get()));
smallNullRow.initToNull();
try
@ -461,7 +461,7 @@ void DiskJoinStep::joinFcn()
l_largeRG.initRow(&l_largeRow, true);
boost::scoped_array<uint8_t> largeNullMem(new uint8_t[l_largeRow.getSize()]);
l_largeRow.setData(largeNullMem.get());
l_largeRow.setData(rowgroup::Row::Pointer(largeNullMem.get()));
l_largeRow.initToNull();
in->tupleJoiner->getUnmarkedRows(&unmatched);

View File

@ -322,7 +322,8 @@ void GroupConcatAgUM::initialize()
fGroupConcat->fRowGroup.initRow(&fRow, true);
fData.reset(new uint8_t[fRow.getSize()]);
fRow.setData(fData.get());
fRow.setData(rowgroup::Row::Pointer(fData.get()));
}
void GroupConcatAgUM::processRow(const rowgroup::Row& inRow)

View File

@ -315,7 +315,7 @@ void JsonArrayAggregatAgUM::initialize()
fGroupConcat->fRowGroup.initRow(&fRow, true);
fData.reset(new uint8_t[fRow.getSize()]);
fRow.setData(fData.get());
fRow.setData(rowgroup::Row::Pointer(fData.get()));
}
void JsonArrayAggregatAgUM::processRow(const rowgroup::Row& inRow)

View File

@ -592,7 +592,7 @@ void SimpleScalarTransformer::getScalarResult()
fRowGroup.initRow(&row);
fRowGroup.getRow(0, &row);
fRowData.reset(new uint8_t[fRow.getSize()]);
fRow.setData(fRowData.get());
fRow.setData(rowgroup::Row::Pointer(fRowData.get()));
copyRow(row, &fRow);
// For exist filter, stop the query after one or more rows retrieved.

View File

@ -199,7 +199,7 @@ TupleBPS::JoinLocalData::JoinLocalData(TupleBPS* pTupleBPS, RowGroup& primRowGro
local_primRG.initRow(&largeSideRow);
local_outputRG.initRow(&joinedBaseRow, true);
joinedBaseRowData.reset(new uint8_t[joinedBaseRow.getSize()]);
joinedBaseRow.setData(joinedBaseRowData.get());
joinedBaseRow.setData(rowgroup::Row::Pointer(joinedBaseRowData.get()));
joinedBaseRow.initToNull();
largeMapping = makeMapping(local_primRG, local_outputRG);
@ -222,7 +222,7 @@ TupleBPS::JoinLocalData::JoinLocalData(TupleBPS* pTupleBPS, RowGroup& primRowGro
joinFERG.initRow(&joinFERow, true);
joinFERowData.reset(new uint8_t[joinFERow.getSize()]);
memset(joinFERowData.get(), 0, joinFERow.getSize());
joinFERow.setData(joinFERowData.get());
joinFERow.setData(rowgroup::Row::Pointer(joinFERowData.get()));
fergMappings[smallSideCount] = makeMapping(local_primRG, joinFERG);
}
@ -230,13 +230,13 @@ TupleBPS::JoinLocalData::JoinLocalData(TupleBPS* pTupleBPS, RowGroup& primRowGro
{
joinerMatchesRGs[i].initRow(&(smallNulls[i]), true);
smallNullMemory[i].reset(new uint8_t[smallNulls[i].getSize()]);
smallNulls[i].setData(smallNullMemory[i].get());
smallNulls[i].setData(rowgroup::Row::Pointer(smallNullMemory[i].get()));
smallNulls[i].initToNull();
}
local_primRG.initRow(&largeNull, true);
largeNullMemory.reset(new uint8_t[largeNull.getSize()]);
largeNull.setData(largeNullMemory.get());
largeNull.setData(rowgroup::Row::Pointer(largeNullMemory.get()));
largeNull.initToNull();
}
}
@ -568,7 +568,7 @@ TupleBPS::TupleBPS(const pColScanStep& rhs, const JobInfo& jobInfo) : BatchPrimi
std::ostringstream oss;
oss << "Error getting AUX column OID for table " << tableName.toString();
throw runtime_error(oss.str());
}
}
if (fOidAux > 3000)
{

View File

@ -5371,7 +5371,7 @@ void TupleAggregateStep::threadedAggregateRowGroups(uint32_t threadID)
{
multiDist->subAggregators()[j]->getOutputRowGroup()->initRow(&distRow[j], true);
distRowData[j].reset(new uint8_t[distRow[j].getSize()]);
distRow[j].setData(distRowData[j].get());
distRow[j].setData(rowgroup::Row::Pointer(distRowData[j].get()));
hashLens.push_back(multiDist->subAggregators()[j]->aggMapKeyLength());
}
}

View File

@ -180,7 +180,7 @@ void TupleConstantStep::constructContanstRow(const JobInfo& jobInfo)
{
// construct a row with only the constant values
fConstRowData.reset(new uint8_t[fRowConst.getSize()]);
fRowConst.setData(fConstRowData.get());
fRowConst.setData(rowgroup::Row::Pointer(fConstRowData.get()));
fRowConst.initToNull(); // make sure every col is init'd to something, because later we copy the whole row
const vector<CalpontSystemCatalog::ColDataType>& types = fRowGroupOut.getColTypes();

View File

@ -1377,7 +1377,7 @@ void TupleHashJoinStep::startJoinThreads()
Row smallRow;
smallRGs[i].initRow(&smallRow, true);
smallNullMemory[i].reset(new uint8_t[smallRow.getSize()]);
smallRow.setData(smallNullMemory[i].get());
smallRow.setData(rowgroup::Row::Pointer(smallNullMemory[i].get()));
smallRow.initToNull();
}
@ -1427,12 +1427,12 @@ void TupleHashJoinStep::finishSmallOuterJoin()
{
smallRGs[i].initRow(&smallRowTemplates[i]);
smallRGs[i].initRow(&smallNullRows[i], true);
smallNullRows[i].setData(smallNullMemory[i].get());
smallNullRows[i].setData(rowgroup::Row::Pointer(smallNullMemory[i].get()));
}
largeRG.initRow(&largeNullRow, true);
largeNullMemory.reset(new uint8_t[largeNullRow.getSize()]);
largeNullRow.setData(largeNullMemory.get());
largeNullRow.setData(rowgroup::Row::Pointer(largeNullMemory.get()));
largeNullRow.initToNull();
joinedData.reinit(l_outputRG);
@ -1529,14 +1529,14 @@ void TupleHashJoinStep::joinRunnerFcn(uint32_t threadID)
local_outputRG.initRow(&joinedRow);
local_outputRG.initRow(&baseRow, true);
baseRowData.reset(new uint8_t[baseRow.getSize()]);
baseRow.setData(baseRowData.get());
baseRow.setData(rowgroup::Row::Pointer(baseRowData.get()));
if (hasJoinFE)
{
local_joinFERG = joinFilterRG;
local_joinFERG.initRow(&joinFERow, true);
joinFERowData.reset(new uint8_t[joinFERow.getSize()]);
joinFERow.setData(joinFERowData.get());
joinFERow.setData(rowgroup::Row::Pointer(joinFERowData.get()));
}
if (fe2)