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

Function ParseAggregateMeasure

cpp/src/arrow/engine/substrait/relation_internal.cc:302–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300namespace internal {
301
302Result<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
328ARROW_ENGINE_EXPORT Result<DeclarationInfo> MakeAggregateDeclaration(
329 acero::Declaration input_decl, std::shared_ptr<Schema> aggregate_schema,

Callers

nothing calls this directly

Calls 7

NotImplementedFunction · 0.70
ARROW_ASSIGN_OR_RAISEFunction · 0.70
InvalidFunction · 0.50
emptyMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected