MCPcopy Create free account
hub / github.com/apache/arrow / Make

Method Make

cpp/src/arrow/acero/groupby_aggregate_node.cc:180–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180Result<ExecNode*> GroupByNode::Make(ExecPlan* plan, std::vector<ExecNode*> inputs,
181 const ExecNodeOptions& options) {
182 RETURN_NOT_OK(ValidateExecNodeInputs(plan, inputs, 1, "GroupByNode"));
183
184 auto input = inputs[0];
185 const auto& aggregate_options = checked_cast<const AggregateNodeOptions&>(options);
186 const auto& keys = aggregate_options.keys;
187 const auto& segment_keys = aggregate_options.segment_keys;
188 auto aggs = aggregate_options.aggregates;
189 bool is_cpu_parallel = plan->query_context()->executor()->GetCapacity() > 1;
190
191 const auto& input_schema = input->output_schema();
192 auto exec_ctx = plan->query_context()->exec_context();
193 ARROW_ASSIGN_OR_RAISE(
194 auto args, MakeAggregateNodeArgs(input_schema, keys, segment_keys, aggs, exec_ctx,
195 is_cpu_parallel));
196
197 return input->plan()->EmplaceNode<GroupByNode>(
198 input, std::move(args.output_schema), std::move(args.grouping_key_field_ids),
199 std::move(args.segment_key_field_ids), std::move(args.segmenter),
200 std::move(args.kernel_intypes), std::move(args.target_fieldsets),
201 std::move(args.aggregates), std::move(args.kernels));
202}
203
204Status GroupByNode::ResetKernelStates() {
205 auto ctx = plan()->query_context()->exec_context();

Callers

nothing calls this directly

Calls 5

ValidateExecNodeInputsFunction · 0.85
query_contextMethod · 0.80
exec_contextMethod · 0.80
GetCapacityMethod · 0.45
executorMethod · 0.45

Tested by

no test coverage detected