Perseus commented on code in PR #3283:
URL: https://github.com/apache/iceberg-rust/pull/3283#discussion_r4511914945


##########
crates/iceberg/src/encryption/io.rs:
##########
@@ -74,8 +74,16 @@ impl EncryptedInputFile {
 
     /// Creates a reader that transparently decrypts on each read.
     pub async fn reader(&self) -> Result<Box<dyn FileRead>> {
-        let encrypted_length = self.encrypted_length()?;
         let raw_reader = self.inner.reader().await?;
+        self.decrypt_reader(raw_reader)
+    }
+
+    /// Wraps a transparently decrypting reader over the given `raw_reader`
+    pub(crate) fn decrypt_reader(

Review Comment:
   
https://github.com/apache/iceberg-rust/pull/3283/changes#diff-a9357ed332174dbf3271413633da29990c6357924a5a8fc50d1e58740ba5dd5dR438-R441
 I did add some comments where it's being used, I'll port them here as well.
   
   Could you help me understand this 
   > I prefer the original wrap version, e.g. providing a transform function. 
This ensures that the file is correctly deciphering the right file.
   
   Is this because there is now a possibility of a *different* file reader 
being passed into the function, instead of using the one that the struct was 
initialized with?
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to