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

Method create

bolt/core/PlanNode.cpp:458–498  ·  view source on GitHub ↗

static

Source from the content-addressed store, hash-verified

456
457// static
458PlanNodePtr AggregationNode::create(const folly::dynamic& obj, void* context) {
459 auto source = deserializeSingleSource(obj, context);
460
461 auto groupingKeys = deserializeFields(obj["groupingKeys"], context);
462 auto preGroupedKeys = deserializeFields(obj["preGroupedKeys"], context);
463 auto aggregateNames = deserializeStrings(obj["aggregateNames"]);
464
465 std::vector<Aggregate> aggregates;
466 for (const auto& aggregate : obj["aggregates"]) {
467 aggregates.push_back(Aggregate::deserialize(aggregate, context));
468 }
469
470 std::vector<vector_size_t> globalGroupingSets;
471 for (const auto& globalSet : obj["globalGroupingSets"]) {
472 globalGroupingSets.push_back(globalSet.asInt());
473 }
474
475 std::optional<FieldAccessTypedExprPtr> groupId;
476 if (obj.count("groupId")) {
477 groupId = ISerializable::deserialize<FieldAccessTypedExpr>(
478 obj["groupId"], context);
479 }
480
481 auto planNode = std::make_shared<AggregationNode>(
482 deserializePlanNodeId(obj),
483 stepFromName(obj["step"].asString()),
484 groupingKeys,
485 preGroupedKeys,
486 aggregateNames,
487 aggregates,
488 globalGroupingSets,
489 groupId,
490 obj["ignoreNullKeys"].asBool(),
491 deserializeSingleSource(obj, context));
492
493#if defined BOLT_HAS_CUDF && BOLT_HAS_CUDF == 1
494 planNode->enableCudfIfDesired(obj);
495#endif
496
497 return planNode;
498}
499
500namespace {
501RowTypePtr getExpandOutputType(

Callers

nothing calls this directly

Calls 15

deserializeSingleSourceFunction · 0.85
deserializeFieldsFunction · 0.85
deserializePlanNodeIdFunction · 0.85
deserializeSourcesFunction · 0.85
restoreVectorFunction · 0.85
deserializeRowTypeFunction · 0.85
joinTypeFromNameFunction · 0.85
deserializeSortingOrdersFunction · 0.85
stringToCommitStrategyFunction · 0.85
enableCudfIfDesiredMethod · 0.80
deserializeStringsFunction · 0.70

Tested by

no test coverage detected