| 300 | namespace internal { |
| 301 | |
| 302 | Result<compute::Aggregate> ParseAggregateMeasure( |
| 303 | const substrait::AggregateRel::Measure& agg_measure, const ExtensionSet& ext_set, |
| 304 | const ConversionOptions& conversion_options, bool is_hash, |
| 305 | const std::shared_ptr<Schema> input_schema) { |
| 306 | if (agg_measure.has_measure()) { |
| 307 | if (agg_measure.has_filter()) { |
| 308 | return Status::NotImplemented("Aggregate filters are not supported."); |
| 309 | } |
| 310 | const auto& agg_func = agg_measure.measure(); |
| 311 | ARROW_ASSIGN_OR_RAISE(SubstraitCall aggregate_call, |
| 312 | FromProto(agg_func, is_hash, ext_set, conversion_options)); |
| 313 | ExtensionIdRegistry::SubstraitAggregateToArrow converter; |
| 314 | if (aggregate_call.id().uri.empty() || aggregate_call.id().uri[0] == '/') { |
| 315 | ARROW_ASSIGN_OR_RAISE(converter, |
| 316 | ext_set.registry()->GetSubstraitAggregateToArrowFallback( |
| 317 | aggregate_call.id().name)); |
| 318 | } else { |
| 319 | ARROW_ASSIGN_OR_RAISE(converter, ext_set.registry()->GetSubstraitAggregateToArrow( |
| 320 | aggregate_call.id())); |
| 321 | } |
| 322 | return converter(aggregate_call); |
| 323 | } else { |
| 324 | return Status::Invalid("substrait::AggregateFunction not provided"); |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | ARROW_ENGINE_EXPORT Result<DeclarationInfo> MakeAggregateDeclaration( |
| 329 | acero::Declaration input_decl, std::shared_ptr<Schema> aggregate_schema, |
nothing calls this directly
no test coverage detected