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


##########
arrow/src/array/array.rs:
##########
@@ -356,6 +356,19 @@ pub trait ArrayAccessor: Array {
     /// # Safety
     /// Caller is responsible for ensuring that the index is within the bounds 
of the array
     unsafe fn value_unchecked(&self, index: usize) -> Self::Item;
+
+    /// Returns a values accessor [`ArrayValuesAccessor`] for this 
[`ArrayAccessor`] if
+    /// it supports. Returns [`None`] if it doesn't support accessing values 
directly.
+    fn get_values_accessor(&self) -> Option<&dyn ArrayValuesAccessor<Item = 
Self::Item>> {

Review Comment:
   I don't want to return a `Option<&[Self::Item]>` directly as the semantics 
look weird (i.e. some `ArrayAccessor` doesn't provide `values`). This is to 
return self as `ArrayValuesAccessor` so the caller can call `values`.
   
   But I think I will remove it based on 
https://github.com/apache/arrow-rs/pull/2740#discussion_r973557949.



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to