jayzhan211 commented on code in PR #6748:
URL: https://github.com/apache/arrow-rs/pull/6748#discussion_r1849376150


##########
parquet/src/arrow/async_reader/mod.rs:
##########
@@ -158,7 +158,7 @@ pub trait AsyncFileReader: Send {
     fn get_metadata(&mut self) -> BoxFuture<'_, Result<Arc<ParquetMetaData>>>;
 }
 
-impl AsyncFileReader for Box<dyn AsyncFileReader> {
+impl<'reader> AsyncFileReader for Box<dyn AsyncFileReader + 'reader> {

Review Comment:
   
   
   
   ```suggestion
   /// Implements AsyncFileReader for boxed readers with an explicit lifetime 
'reader.
   /// This allows Box<dyn AsyncFileReader + 'reader> to be used as an 
AsyncFileReader,
   /// which is needed when the boxed reader contains references with lifetimes
   /// shorter than 'static.
   
   impl<'reader> AsyncFileReader for Box<dyn AsyncFileReader + 'reader> {
   ```



##########
parquet/src/arrow/async_reader/mod.rs:
##########
@@ -158,7 +158,7 @@ pub trait AsyncFileReader: Send {
     fn get_metadata(&mut self) -> BoxFuture<'_, Result<Arc<ParquetMetaData>>>;
 }
 
-impl AsyncFileReader for Box<dyn AsyncFileReader> {
+impl<'reader> AsyncFileReader for Box<dyn AsyncFileReader + 'reader> {

Review Comment:
   Let's add comment to them. If my understand correctly, the need to return 
Boxed Trait is the reason why we need a lifetime shorter than static, so the 
inner value in Box -- Reader has the same lifetime as Box



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