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

Function findPartialAggregation

bolt/exec/tests/utils/PlanBuilder.cpp:748–767  ·  view source on GitHub ↗

Checks that specified plan node is a partial or intermediate aggregation or local exchange over the same. Returns a pointer to core::AggregationNode.

Source from the content-addressed store, hash-verified

746/// Checks that specified plan node is a partial or intermediate aggregation or
747/// local exchange over the same. Returns a pointer to core::AggregationNode.
748const core::AggregationNode* findPartialAggregation(
749 const core::PlanNode* planNode) {
750 const core::AggregationNode* aggNode;
751 if (auto exchange = dynamic_cast<const core::LocalPartitionNode*>(planNode)) {
752 aggNode = dynamic_cast<const core::AggregationNode*>(
753 exchange->sources()[0].get());
754 } else if (auto merge = dynamic_cast<const core::LocalMergeNode*>(planNode)) {
755 aggNode =
756 dynamic_cast<const core::AggregationNode*>(merge->sources()[0].get());
757 } else {
758 aggNode = dynamic_cast<const core::AggregationNode*>(planNode);
759 }
760 BOLT_CHECK_NOT_NULL(
761 aggNode,
762 "Current plan node must be one of: partial or intermediate aggregation, "
763 "local merge or exchange. Got: {}",
764 planNode->toString());
765 BOLT_CHECK(exec::isPartialOutput(aggNode->step()));
766 return aggNode;
767}
768} // namespace
769
770PlanBuilder& PlanBuilder::intermediateAggregation(const bool useGPU) {

Callers 1

PlanBuilder.cppFile · 0.85

Calls 4

isPartialOutputFunction · 0.85
stepMethod · 0.80
getMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected