ggershinsky commented on code in PR #9592:
URL: https://github.com/apache/iceberg/pull/9592#discussion_r1486083697


##########
api/src/main/java/org/apache/iceberg/io/FileIO.java:
##########
@@ -42,6 +46,30 @@ default InputFile newInputFile(String path, long length) {
     return newInputFile(path);
   }
 
+  default InputFile newInputFile(DataFile file) {
+    Preconditions.checkArgument(
+        file.keyMetadata() == null,
+        "Cannot decrypt data file: {} (use DecryptingFileIO)",

Review Comment:
   EncryptingFileIO?



##########
api/src/main/java/org/apache/iceberg/io/FileIO.java:
##########
@@ -42,6 +46,30 @@ default InputFile newInputFile(String path, long length) {
     return newInputFile(path);
   }
 
+  default InputFile newInputFile(DataFile file) {
+    Preconditions.checkArgument(
+        file.keyMetadata() == null,
+        "Cannot decrypt data file: {} (use DecryptingFileIO)",
+        file.path());
+    return newInputFile(file.path().toString());
+  }
+
+  default InputFile newInputFile(DeleteFile file) {
+    Preconditions.checkArgument(
+        file.keyMetadata() == null,
+        "Cannot decrypt delete file: {} (use DecryptingFileIO)",

Review Comment:
   +1



##########
api/src/main/java/org/apache/iceberg/io/FileIO.java:
##########
@@ -42,6 +46,30 @@ default InputFile newInputFile(String path, long length) {
     return newInputFile(path);
   }
 
+  default InputFile newInputFile(DataFile file) {
+    Preconditions.checkArgument(
+        file.keyMetadata() == null,
+        "Cannot decrypt data file: {} (use DecryptingFileIO)",
+        file.path());
+    return newInputFile(file.path().toString());
+  }
+
+  default InputFile newInputFile(DeleteFile file) {
+    Preconditions.checkArgument(
+        file.keyMetadata() == null,
+        "Cannot decrypt delete file: {} (use DecryptingFileIO)",
+        file.path());
+    return newInputFile(file.path().toString());
+  }
+
+  default InputFile newInputFile(ManifestFile manifest) {
+    Preconditions.checkArgument(
+        manifest.keyMetadata() == null,
+        "Cannot decrypt manifest: {} (use DecryptingFileIO)",

Review Comment:
   +1



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