| 65 | } |
| 66 | |
| 67 | AggregationNodeBase::AggregationNodeBase( |
| 68 | ObjectPool* pool, const AggregationPlanNode& pnode, const DescriptorTbl& descs) |
| 69 | : ExecNode(pool, pnode, descs), |
| 70 | replicate_input_(pnode.tnode_->agg_node.replicate_input) { |
| 71 | // Create the Aggregator nodes from their configs. |
| 72 | int num_aggs = pnode.aggs_.size(); |
| 73 | for (int i = 0; i < num_aggs; ++i) { |
| 74 | const AggregatorConfig* agg = pnode.aggs_[i]; |
| 75 | unique_ptr<Aggregator> node; |
| 76 | if (agg->GetNumGroupingExprs() == 0) { |
| 77 | const NonGroupingAggregatorConfig* non_grouping_config = |
| 78 | static_cast<const NonGroupingAggregatorConfig*>(agg); |
| 79 | node.reset(new NonGroupingAggregator(this, pool_, *non_grouping_config)); |
| 80 | } else { |
| 81 | const GroupingAggregatorConfig* grouping_config = |
| 82 | static_cast<const GroupingAggregatorConfig*>(agg); |
| 83 | DCHECK(grouping_config != nullptr); |
| 84 | node.reset(new GroupingAggregator(this, pool_, *grouping_config, |
| 85 | pnode.tnode_->agg_node.estimated_input_cardinality)); |
| 86 | } |
| 87 | aggs_.push_back(std::move(node)); |
| 88 | runtime_profile_->AddChild(aggs_[i]->runtime_profile()); |
| 89 | } |
| 90 | fast_limit_check_ = pnode.tnode_->agg_node.fast_limit_check; |
| 91 | } |
| 92 | |
| 93 | Status AggregationNodeBase::Prepare(RuntimeState* state) { |
| 94 | SCOPED_TIMER(runtime_profile_->total_time_counter()); |
nothing calls this directly
no test coverage detected