yjshen edited a comment on pull request #1905:
URL: 
https://github.com/apache/arrow-datafusion/pull/1905#issuecomment-1059731719


   I'm afraid not. 😬
   Arc::get_mut needs self to be a mutable reference.
   ```rust
       pub fn get_mut(this: &mut Self) -> Option<&mut T> {
   ```
   but not the case in ChunkReader:
   ```rust
   pub trait ChunkReader: Length + Send + Sync {
       type T: Read + Send;
       /// get a serialy readeable slice of the current reader
       /// This should fail if the slice exceeds the current bounds
       fn get_read(&self, start: u64, length: usize) -> Result<Self::T>;
   }
   ```
   `get_read` &self is immutable
   
   And RefCell doesn't work either, since :
   ```
   `RefCell<(dyn ObjectReader + 'static)>` cannot be shared between threads 
safely
       |
       = help: the trait `Sync` is not implemented for `RefCell<(dyn 
ObjectReader + 'static)>`
       = note: required because of the requirements on the impl of 
`std::marker::Send` for `Arc<RefCell<(dyn ObjectReader + 'static)>>`
   
   ```
   Even with the Sync removed from `pub trait ChunkReader: Length + Send ` 
since it's imposed by the remaining Send.


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