amogh-jahagirdar commented on code in PR #14886:
URL: https://github.com/apache/iceberg/pull/14886#discussion_r2665995709


##########
api/src/main/java/org/apache/iceberg/actions/DeleteOrphanFiles.java:
##########
@@ -142,6 +142,11 @@ default DeleteOrphanFiles equalAuthorities(Map<String, 
String> newEqualAuthoriti
   interface Result {
     /** Returns locations of orphan files. */
     Iterable<String> orphanFileLocations();
+
+    /** Returns the total number of orphan files. */
+    default long orphanFilesCount() {
+      return 0;

Review Comment:
   I wouldn't optimize for the case where someone extends this result interface 
but forgets to override AND forgets to set the field.
   
   Throwing an exception as a default is probably also OK but also just seems 
needles and can trigger needless failures when someone tries to dereference the 
number of files, after all, if someone can do orphan file removal in a custom 
implementation (because they have their own custom result type), they'll also 
probably be able to count how many files they also deleted.
   
   I'd stick with just returning 0 for consistency with some of the other cases.



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