liurenjie1024 commented on issue #172:
URL: https://github.com/apache/iceberg-rust/issues/172#issuecomment-2496527112

   Hi, @BlakeOrth  Thanks for trying this, and yes it's quite close to what's 
in my mind. So the question is that we can't keep the return type of 
`reader`/`writer` function? I think there are two approaches to this problem:
   1. Breaking current ap and change return type to `Arc<dyn 
FileRead>`/`Arc<dyn FileWrite>` .
   2. Provide a wrapper around this. For example, 
   ```rust
   struct FileReadWrapper(Arc<dyn FileRead>);
   impl FileRead for FileReaderWrapper {
       ...
   }
   ```
   
   Solution 2 is expected maintain backward compatibility, but it's somehow 
ugly since it maintains another layer of unnecessary abstraction. There is a 
solution which combines the benefits of both:
   1. Use solution 2.
   2. Mark current `read`/`write` method as deprecated.
   3. Provide another method to return types like `Result<Arc<dyn 
FileRead>>`/`Result<Arc<dyn FileWrite>>` and suggest others to use this method.
   4. Remove deprecated method in future.


-- 
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: issues-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to