MCPcopy Create free account
hub / github.com/bytedance/bolt / copyKeyAndUpdateGroups

Method copyKeyAndUpdateGroups

bolt/exec/GroupingSet.cpp:1321–1353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1319 }
1320 }
1321 }
1322
1323 for (auto& aggregate : aggregates_) {
1324 BOLT_CHECK(aggregate.sortingKeys.empty());
1325 aggregate.function->initializeNewGroups(
1326 groups.data(),
1327 folly::Range<const vector_size_t*>(
1328 groupIndicesOfRows_.data() + initGroupCount,
1329 groups.size() - initGroupCount));
1330 }
1331 }
1332 initGroupCount = distinctRows.size();
1333 }
1334}
1335
1336void GroupingSet::copyKeyAndUpdateGroups(
1337 std::vector<char*>& rows,
1338 std::vector<char*>& groupOfRows,
1339 std::vector<char*>& distinctRows,
1340 std::vector<char*>& groups,
1341 size_t& initGroupCount,
1342 const RowContainer* container,
1343 const RowVectorPtr& result,
1344 const vector_size_t resultOffset) {
1345 if (rows.empty()) {
1346 return;
1347 }
1348 BOLT_CHECK_EQ(rows.size(), groupOfRows.size());
1349 copyKeyAndInitGroup(
1350 distinctRows, groups, initGroupCount, container, result, resultOffset);
1351 NanosecondTimer aggTimer(&stats_.aggOutputUpdateTimeNs);
1352 // calculate rows into groupOfRows
1353 SelectivityVector selections(groupOfRows.size());
1354 auto& accumulators = container->accumulators();
1355 BOLT_CHECK_EQ(accumulators.size(), aggregates_.size());
1356 for (auto i = 0; i < aggregates_.size(); ++i) {

Callers

nothing calls this directly

Calls 8

accumulatorsMethod · 0.80
createFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
extractForSpillMethod · 0.45
dataMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected