[C++][Acero] VAR_ARG does not work for hash aggregate kernels
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
### Describe the bug, including details regarding any error messages, version, and platform.
"uint32: group_id_array" is appended to input_types for hash aggregate kernel/function signature.
This causes two issues :
- function/kernel resolution does not work for functions with var_arg input because Function::DispatchExact fails.
- group_id_array position in ExecBatch becomes kernel dependent (which is less an issue)
Possible solution is to change hash aggregate kernel signature as to have "uint32: group_id_array" at position 0:
```
HashAggregateKernel MakeKernel(InputType argument_type, KernelInit init,
const bool ordered = false) {
return MakeKernel(
KernelSignature::Make({std::move(argument_type), InputType(Type::UINT32)},
OutputType(ResolveGroupOutputType)),
std::move(init), ordered);
}
```
becomes
```
HashAggregateKernel MakeKernel(InputType argument_type, KernelInit init,
const bool ordered = false) {
return MakeKernel(
KernelSignature::Make({InputType(Type::UINT32), std::move(argument_type)},
OutputType(ResolveGroupOutputType)),
std::move(init), ordered);
}
```
An Alternative solution is to change hash aggregate consume signature and avoid transforming original kernel signature:
```
using HashAggregateConsume = Status (*)(KernelContext*, const ExecSpan&);
```
becomes
```
using HashAggregateConsume = Status (*)(KernelContext*, const ExecValue&, const ExecSpan&);
```
### Component(s)
C++
Contributor guide
Assessment
This issue has not been assessed yet.