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

Method mapAccumulate

src/processor/map/map_accumulate.cpp:12–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10namespace processor {
11
12std::unique_ptr<PhysicalOperator> PlanMapper::mapAccumulate(
13 const LogicalOperator* logicalOperator) {
14 const auto& acc = logicalOperator->constCast<LogicalAccumulate>();
15 auto outSchema = acc.getSchema();
16 auto inSchema = acc.getChild(0)->getSchema();
17 auto prevOperator = mapOperator(acc.getChild(0).get());
18 auto expressions = acc.getPayloads();
19 auto resultCollector = createResultCollector(acc.getAccumulateType(), expressions, inSchema,
20 std::move(prevOperator));
21 auto table = resultCollector->getResultFTable();
22 auto maxMorselSize = table->hasUnflatCol() ? 1 : DEFAULT_VECTOR_CAPACITY;
23 if (acc.hasMark()) {
24 expressions.push_back(acc.getMark());
25 }
26 physical_op_vector_t children;
27 children.push_back(std::move(resultCollector));
28 return createFTableScanAligned(expressions, outSchema, table, maxMorselSize,
29 std::move(children));
30}
31
32} // namespace processor
33} // namespace lbug

Callers

nothing calls this directly

Calls 9

hasUnflatColMethod · 0.80
getChildMethod · 0.45
getMethod · 0.45
getPayloadsMethod · 0.45
getAccumulateTypeMethod · 0.45
getResultFTableMethod · 0.45
hasMarkMethod · 0.45
push_backMethod · 0.45
getMarkMethod · 0.45

Tested by

no test coverage detected