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

Function InitKernel

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

Source from the content-addressed store, hash-verified

84}
85
86Result<std::unique_ptr<KernelState>> InitKernel(const HashAggregateKernel* kernel,
87 ExecContext* ctx,
88 const Aggregate& aggregate,
89 const std::vector<TypeHolder>& in_types) {
90 const auto aggr_in_types = ExtendWithGroupIdType(in_types);
91
92 KernelContext kernel_ctx{ctx};
93 const auto* options =
94 arrow::internal::checked_cast<const FunctionOptions*>(aggregate.options.get());
95 if (options == nullptr) {
96 // use known default options for the named function if possible
97 auto maybe_function = ctx->func_registry()->GetFunction(aggregate.function);
98 if (maybe_function.ok()) {
99 options = maybe_function.ValueOrDie()->default_options();
100 }
101 }
102
103 ARROW_ASSIGN_OR_RAISE(
104 auto state,
105 kernel->init(&kernel_ctx, KernelInitArgs{kernel, aggr_in_types, options}));
106 return state;
107}
108
109Result<std::vector<const HashAggregateKernel*>> GetKernels(
110 ExecContext* ctx, const std::vector<Aggregate>& aggregates,

Callers 1

InitKernelsFunction · 0.85

Calls 5

ExtendWithGroupIdTypeFunction · 0.85
ValueOrDieMethod · 0.80
getMethod · 0.45
GetFunctionMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected