alamb opened a new issue #843:
URL: https://github.com/apache/arrow-rs/issues/843


   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   I want to compare two `ArrayRefs` (`Arc<Array>`) with each other
   
   Arrow offers compute kernels for primitive (numeric)  types(e.g. `eq`), and  
separate ones for string types (e.g. `eq_utf8`).
   https://docs.rs/arrow/6.0.0/arrow/compute/kernels/comparison/index.html
   
   This means I have to match on the datatype and then dispatch to the 
appropriate implementation
   
   You can see a bunch of this kind of dispatch (encoded in macros) in 
Datafusion, for example 
https://github.com/apache/arrow-datafusion/blob/81fae230b81b97e93bbb95b284cfda6f4d59552e/datafusion/src/physical_plan/expressions/binary.rs#L289-L328
   
   **Describe the solution you'd like**
   Add functions like `OP_dyn` that did the type dispatch within arrow
   
   So for example, a function like this:
   
   ```rust
   /// Compare the left and right arrays for equality. Returns an error if they 
are not the exact same type
   fn eq_dyn(left: &dyn Array, right: &dyn Array) -> result<BooleanArray> {
     // switch on types and call appropriate eq kernel
   ...
   }
   ```
   
   and `neq_dyn`, `lt_dyn`, etc.
   
   
   **Describe alternatives you've considered**
   Leave it as is
   
   **Additional context**
   See also https://github.com/apache/arrow-datafusion/pull/1163 and 
https://github.com/apache/arrow-rs/issues/842


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