MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / updateNumElementsInDataChunk

Method updateNumElementsInDataChunk

src/processor/result/factorized_table.cpp:730–748  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

728}
729
730void FactorizedTableIterator::updateNumElementsInDataChunk() {
731 auto colOffsetInTupleBuffer = 0ul;
732 for (auto i = 0u; i < factorizedTable.getTableSchema()->getNumColumns(); i++) {
733 auto column = factorizedTable.getTableSchema()->getColumn(i);
734 auto groupID = column->getGroupID();
735 // If this is an unflat column, the number of elements is stored in the
736 // overflow_value_t struct. Otherwise, the number of elements is 1.
737 auto numElementsInDataChunk =
738 column->isFlat() ?
739 1 :
740 ((overflow_value_t*)(currentTupleBuffer + colOffsetInTupleBuffer))->numElements;
741 if (groupID >= flatTuplePositionsInDataChunk.size()) {
742 flatTuplePositionsInDataChunk.resize(groupID + 1);
743 }
744 flatTuplePositionsInDataChunk[groupID] =
745 std::make_pair(0 /* nextIdxToReadInDataChunk */, numElementsInDataChunk);
746 colOffsetInTupleBuffer += column->getNumBytes();
747 }
748}
749
750void FactorizedTableIterator::updateFlatTuplePositionsInDataChunk() {
751 for (auto i = 0u; i < flatTuplePositionsInDataChunk.size(); i++) {

Callers

nothing calls this directly

Calls 8

getColumnMethod · 0.80
getGroupIDMethod · 0.80
getNumBytesMethod · 0.80
getNumColumnsMethod · 0.45
getTableSchemaMethod · 0.45
isFlatMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected