alamb commented on issue #1047:
URL: https://github.com/apache/arrow-rs/issues/1047#issuecomment-1572516580

   What if we made a 'new' set of kernels (that just dispatched to the existing 
ones, if they existed) 
   
   This seems like the ideal user experience from my perspective:
   ```rust
   let scalar = Int64Scalar::new(42);
   let array = Int64Array::from(....);
   
   // Call the "add" kernels in a new module
   let result: Datum = arrow::compute::datum::add(&scalar, &array);
   ```
   
   Maybe the types could look like this:
   ```
   enum Datum<'a> {
       Array(&'a dyn Array),
       Scalar(&'a dyn Scalar),
       OwnedArray(Arc<Array>),
       OwnedSclar(Arc<Scalar>),
   }
   
   impl Into Datum<..> for Int64Scalar {
   ..
   }
   
   
   fn add (left: impl Into<Datum>, right: impl Into<Datum>) -> Datum<'static> {
   ..
   }
   ```
   
   Perhaps?
   
   


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