tustvold commented on a change in pull request #1154:
URL: https://github.com/apache/arrow-rs/pull/1154#discussion_r794926498



##########
File path: parquet/src/file/reader.rs
##########
@@ -43,8 +43,8 @@ pub trait Length {
 /// The ChunkReader trait generates readers of chunks of a source.
 /// For a file system reader, each chunk might contain a clone of File bounded 
on a given range.
 /// For an object store reader, each read can be mapped to a range request.
-pub trait ChunkReader: Length {
-    type T: Read;
+pub trait ChunkReader: Length + Send + Sync {

Review comment:
       These traits need to be both `Send + Sync` as they are used through 
immutable references, e.g. `Arc`

##########
File path: parquet/src/file/serialized_reader.rs
##########
@@ -271,15 +271,15 @@ impl<T: Read> SerializedPageReader<T> {
     }
 }
 
-impl<T: Read> Iterator for SerializedPageReader<T> {
+impl<T: Read + Send> Iterator for SerializedPageReader<T> {
     type Item = Result<Page>;
 
     fn next(&mut self) -> Option<Self::Item> {
         self.get_next_page().transpose()
     }
 }
 
-impl<T: Read> PageReader for SerializedPageReader<T> {
+impl<T: Read + Send> PageReader for SerializedPageReader<T> {

Review comment:
       As `PageReader: Send` it can only be implemented for types that are 
`Send` which is only the case for `SerializedPageReader<T>` if `T: 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to