| 134 | } |
| 135 | |
| 136 | Result<FieldVector> ResolveKernels( |
| 137 | const std::vector<Aggregate>& aggregates, |
| 138 | const std::vector<const HashAggregateKernel*>& kernels, |
| 139 | const std::vector<std::unique_ptr<KernelState>>& states, ExecContext* ctx, |
| 140 | const std::vector<std::vector<TypeHolder>>& types) { |
| 141 | FieldVector fields(types.size()); |
| 142 | |
| 143 | for (size_t i = 0; i < kernels.size(); ++i) { |
| 144 | KernelContext kernel_ctx{ctx}; |
| 145 | kernel_ctx.SetState(states[i].get()); |
| 146 | |
| 147 | const auto aggr_in_types = ExtendWithGroupIdType(types[i]); |
| 148 | ARROW_ASSIGN_OR_RAISE( |
| 149 | auto type, kernels[i]->signature->out_type().Resolve(&kernel_ctx, aggr_in_types)); |
| 150 | fields[i] = field(aggregates[i].function, type.GetSharedPtr()); |
| 151 | } |
| 152 | return fields; |
| 153 | } |
| 154 | |
| 155 | void AggregatesToString(std::stringstream* ss, const Schema& input_schema, |
| 156 | const std::vector<Aggregate>& aggs, |
nothing calls this directly
no test coverage detected