bjchambers opened a new issue, #2839:
URL: https://github.com/apache/arrow-rs/issues/2839

   I previously had generic code along the lines of the following (it was 
actually in evaluator structs, as part of implementing a query evaluator):
   
   ```
   fn<T: ArrowNumericType> perform_math(lhs: &PrimitiveArray<T>, rhs: 
&PrimitiveArray<T>) -> anyhow::Result<ArrayRef>
     where T::Native: std::ops::Add<Output = T::Native> {
     Ok(Arc::new(arrow::compute::add::<T>(lhs.as_ref(), rhs.as_ref())?)
   }
   ```
   
   Now, the `arrow::compute::add` kernel (and many others) require `T::Native: 
ArrowNativeTypeOp`. I tried to update my code to add that to the `where` 
clause, but it isn't possible, since the `ArrowNativeTypeOp` is a public trait 
inside a crate-scoped module.
   
   As far as I can tell this makes it impossible to call any of the kernels 
that require `ArrowNativeTypeOp` from within code that is generic over the 
numeric type... which seems like it would be pretty useful. Could the 
`ArrowNativeTypeOp` be re-exported to support declaring such constraints?


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