devanbenz opened a new issue, #10150:
URL: https://github.com/apache/arrow-rs/issues/10150
### Is your feature request related to a problem or challenge?
Arrow C++ has a product aggregate, arrow-rs has sum/sum_checked but no
product equivalent. Add product and product_checked to
`arrow-arith/src/aggregate.rs`, mirroring sum.
C++ (exists today)
```
arrow::Int64Builder b;
b.AppendValues({1, 2, 3, 4, 5});
auto arr = b.Finish().ValueOrDie();
auto out = arrow::compute::CallFunction("product", {arr});
// out.scalar() == 120
```
### Describe the solution you'd like
```
/// Returns the product of values in the primitive array.
/// Returns `None` if the array is empty or all-null.
pub fn product<T: ArrowNumericType>(array: &PrimitiveArray<T>) ->
Option<T::Native> {
aggregate::<T::Native, T, ProdAccumulator<T::Native>>(array)
}
/// Overflow-checking variant of [`product`].
pub fn product_checked<T: ArrowNumericType>(
array: &PrimitiveArray<T>,
) -> Result<Option<T::Native>, ArrowError> { /* mirror sum_checked/ }
```
### Describe alternatives you've considered
Not implementing product compute kernel.
### Additional context
_No response_
--
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]