viirya commented on code in PR #2579:
URL: https://github.com/apache/arrow-rs/pull/2579#discussion_r954540957


##########
arrow/src/array/array_dictionary.rs:
##########
@@ -493,13 +493,7 @@ where
     &'a V: ArrayAccessor,
 {
     type Item = <&'a V as ArrayAccessor>::Item;
-
-    fn value(&self, index: usize) -> Self::Item {
-        assert!(self.dictionary.is_valid(index), "{}", index);
-        let value_idx = self.dictionary.keys.value(index).to_usize().unwrap();
-        // Dictionary indexes should be valid
-        unsafe { self.values.value_unchecked(value_idx) }
-    }
+    const NULLS_DEFINED: bool = false;
 
     unsafe fn value_unchecked(&self, index: usize) -> Self::Item {

Review Comment:
   Hmm, I think the problematic one is `value_unchecked`, no? `value` always 
checks `is_valid` of the key.
   
   But in `value_unchecked`, the key is retrieved by `value_unchecked` so it 
could be unspecified and cause undefined value from `values`?
   
   



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