You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/12/13 19:39:00 UTC

[GitHub] [arrow-rs] shepmaster edited a comment on pull request #984: Add scalar comparison kernels for DictionaryArray

shepmaster edited a comment on pull request #984:
URL: https://github.com/apache/arrow-rs/pull/984#issuecomment-992806010


   Ah:
   
   > the way you have this function with a single `T` generic parameter means one could not compare a `DictionaryArray<Int8>` (aka that has keys / indexes of `Int8`) that had values of type `DataType::Unt16`
   
   Perhaps one possibility would be to have a trait that maps in the reverse direction? Something like
   
   ```rust
   trait IntoArrowNumericType {
       type Arrow: ArrowNumericType;
   }
   
   impl IntoArrowNumericType for u8 {
       type Arrow = UInt8Type;
   }
   
   pub fn eq_dict_scalar<K, T>(
        left: &DictionaryArray<K>,
        right: T,
    ) -> Result<BooleanArray>
    where
        K: ArrowNumericType,
        T: IntoArrowNumericType,
    { todo!() }
   ```
   
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org