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/05/20 18:01:41 UTC

[GitHub] [arrow-rs] tustvold opened a new issue #332: Dictionary Comparison Uses Wrong Values Array

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


   compare_dict_string always uses the values array of the left operand. This is incorrect.
   
   ```
   fn compare_dict_string<'a, T>(left: &'a Array, right: &'a Array) -> DynComparator<'a>
   where
       T: ArrowDictionaryKeyType,
   {
       let left = left.as_any().downcast_ref::<DictionaryArray<T>>().unwrap();
       let right = right.as_any().downcast_ref::<DictionaryArray<T>>().unwrap();
       let left_keys = left.keys_array();
       let right_keys = right.keys_array();
   
       let left_values = StringArray::from(left.values().data().clone());
       let right_values = StringArray::from(left.values().data().clone());
   
       Box::new(move |i: usize, j: usize| {
           let key_left = left_keys.value(i).to_usize().unwrap();
           let key_right = right_keys.value(j).to_usize().unwrap();
           let left = left_values.value(key_left);
           let right = right_values.value(key_right);
           left.cmp(&right)
       })
   }
   ```


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

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



[GitHub] [arrow-rs] alamb closed issue #332: Dictionary Comparison Uses Wrong Values Array

Posted by GitBox <gi...@apache.org>.
alamb closed issue #332:
URL: https://github.com/apache/arrow-rs/issues/332


   


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

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