[[acero::export]]
| 378 | |
| 379 | // [[acero::export]] |
| 380 | std::shared_ptr<acero::ExecNode> ExecNode_Aggregate( |
| 381 | const std::shared_ptr<acero::ExecNode>& input, cpp11::list options, |
| 382 | std::vector<std::string> key_names) { |
| 383 | std::vector<arrow::compute::Aggregate> aggregates; |
| 384 | |
| 385 | for (cpp11::list name_opts : options) { |
| 386 | auto function = cpp11::as_cpp<std::string>(name_opts["fun"]); |
| 387 | auto opts = make_compute_options(function, name_opts["options"]); |
| 388 | auto target_names = cpp11::as_cpp<std::vector<std::string>>(name_opts["targets"]); |
| 389 | auto name = cpp11::as_cpp<std::string>(name_opts["name"]); |
| 390 | |
| 391 | std::vector<arrow::FieldRef> targets; |
| 392 | for (auto&& target : target_names) { |
| 393 | targets.emplace_back(std::move(target)); |
| 394 | } |
| 395 | aggregates.push_back(arrow::compute::Aggregate{std::move(function), opts, |
| 396 | std::move(targets), std::move(name)}); |
| 397 | } |
| 398 | |
| 399 | std::vector<arrow::FieldRef> keys; |
| 400 | for (auto&& name : key_names) { |
| 401 | keys.emplace_back(std::move(name)); |
| 402 | } |
| 403 | return MakeExecNodeOrStop( |
| 404 | "aggregate", input->plan(), {input.get()}, |
| 405 | acero::AggregateNodeOptions{std::move(aggregates), std::move(keys)}); |
| 406 | } |
| 407 | |
| 408 | // [[acero::export]] |
| 409 | std::shared_ptr<acero::ExecNode> ExecNode_Join( |
no test coverage detected