static
| 456 | |
| 457 | // static |
| 458 | PlanNodePtr 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 | |
| 500 | namespace { |
| 501 | RowTypePtr getExpandOutputType( |
nothing calls this directly
no test coverage detected