| 215 | } |
| 216 | |
| 217 | Result<std::shared_ptr<Buffer>> CreateScanAggSubstrait( |
| 218 | Id function_id, const std::shared_ptr<Table>& input_table, |
| 219 | const std::vector<int>& key_idxs, const std::vector<int>& arg_idxs, |
| 220 | const DataType& output_type) { |
| 221 | ExtensionSet ext_set; |
| 222 | |
| 223 | ARROW_ASSIGN_OR_RAISE(std::unique_ptr<substrait::ReadRel> read, |
| 224 | CreateRead(*input_table, &ext_set)); |
| 225 | ARROW_ASSIGN_OR_RAISE( |
| 226 | std::unique_ptr<substrait::AggregateRel> agg, |
| 227 | CreateAgg(function_id, key_idxs, arg_idxs, output_type, &ext_set)); |
| 228 | |
| 229 | auto read_rel = std::make_unique<substrait::Rel>(); |
| 230 | read_rel->set_allocated_read(read.release()); |
| 231 | agg->set_allocated_input(read_rel.release()); |
| 232 | |
| 233 | auto agg_rel = std::make_unique<substrait::Rel>(); |
| 234 | agg_rel->set_allocated_aggregate(agg.release()); |
| 235 | |
| 236 | ARROW_ASSIGN_OR_RAISE(std::unique_ptr<substrait::Plan> plan, |
| 237 | CreatePlan(std::move(agg_rel), &ext_set)); |
| 238 | return Buffer::FromString(plan->SerializeAsString()); |
| 239 | } |
| 240 | |
| 241 | } // namespace internal |
| 242 | } // namespace engine |
no test coverage detected