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

Function GetKernel

cpp/src/arrow/acero/aggregate_internal.cc:67–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67Result<const HashAggregateKernel*> GetKernel(ExecContext* ctx, const Aggregate& aggregate,
68 const std::vector<TypeHolder>& in_types) {
69 const auto aggr_in_types = ExtendWithGroupIdType(in_types);
70 ARROW_ASSIGN_OR_RAISE(auto function,
71 ctx->func_registry()->GetFunction(aggregate.function));
72 if (function->kind() != Function::HASH_AGGREGATE) {
73 if (function->kind() == Function::SCALAR_AGGREGATE) {
74 return Status::Invalid("The provided function (", aggregate.function,
75 ") is a scalar aggregate function. Since there are "
76 "keys to group by, a hash aggregate function was "
77 "expected (normally these start with hash_)");
78 }
79 return Status::Invalid("The provided function(", aggregate.function,
80 ") is not an aggregate function");
81 }
82 ARROW_ASSIGN_OR_RAISE(const Kernel* kernel, function->DispatchExact(aggr_in_types));
83 return static_cast<const HashAggregateKernel*>(kernel);
84}
85
86Result<std::unique_ptr<KernelState>> InitKernel(const HashAggregateKernel* kernel,
87 ExecContext* ctx,

Callers 1

GetKernelsFunction · 0.85

Calls 3

ExtendWithGroupIdTypeFunction · 0.85
InvalidFunction · 0.50
kindMethod · 0.45

Tested by

no test coverage detected