aokolnychyi commented on code in PR #11446:
URL: https://github.com/apache/iceberg/pull/11446#discussion_r1826712824


##########
api/src/main/java/org/apache/iceberg/util/ContentFileUtil.java:
##########
@@ -84,4 +85,25 @@ public static String referencedDataFileLocation(DeleteFile 
deleteFile) {
     CharSequence location = referencedDataFile(deleteFile);
     return location != null ? location.toString() : null;
   }
+
+  public static long contentSizeInBytes(ContentFile<?> file) {
+    if (file.content() == FileContent.DATA) {
+      return file.fileSizeInBytes();
+    } else {
+      DeleteFile deleteFile = (DeleteFile) file;
+      return isDV(deleteFile) ? deleteFile.contentSizeInBytes() : 
deleteFile.fileSizeInBytes();
+    }
+  }
+
+  public static long contentSizeInBytes(Iterable<? extends ContentFile<?>> 
files) {

Review Comment:
   Not using streams for performance reasons.



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