awalga opened a new issue, #41723:
URL: https://github.com/apache/arrow/issues/41723

   ### 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++


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to