askoa commented on issue #3520:
URL: https://github.com/apache/arrow-rs/issues/3520#issuecomment-1398136541

   I am starting to write `Iterator` / `ArrayAccessor` for 
`RunEndEncodedArray`. I could see two scenarios for accessing the values
   
   1. The caller know the physical index and just wants value in that physical 
index. 
       - This method is useful when implementing iterators. The iterator can 
decide if the physical index has to be increased in O(1) time. After the 
decision is made, the iterator needs to access the value in the physical index.
   2.  The caller does _not_ know the physical index and trying to access a 
value in logical index. A binary search has to be implemented to determine 
physical index based on logical index. This will take O(log N) time.
       - This method is useful when the caller wants to access only few random 
indices (may be in `take` kernels?) 
   
   My questions are below 
     1. is it okay to implement two `ArrayAccessor` for `RunEndEncodedArray`. 
One based on logical index and one based on physical index?
     2. `ArrayIter` cannot be used as is to implement an `Iterator`. REE 
iterator needs to store two values and need a different increment logic. Is it 
okay to implement `RunEndEncodedArrayIter` and not use `ArrayIter`?
   
   cc: @tustvold @viirya @alamb 


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