You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "RussellSpitzer (via GitHub)" <gi...@apache.org> on 2023/06/30 21:57:46 UTC

[GitHub] [iceberg] RussellSpitzer commented on a diff in pull request #7914: Use SupportsPrefixOperations for Remove OrphanFile Procedure

RussellSpitzer commented on code in PR #7914:
URL: https://github.com/apache/iceberg/pull/7914#discussion_r1248309832


##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/actions/DeleteOrphanFilesSparkAction.java:
##########
@@ -303,6 +304,19 @@ private Dataset<String> listedFileDS() {
     List<String> subDirs = Lists.newArrayList();
     List<String> matchingFiles = Lists.newArrayList();
 
+    if (table.io() instanceof SupportsPrefixOperations) {
+      Iterator<org.apache.iceberg.io.FileInfo> iterator = ((SupportsPrefixOperations) table.io()).listPrefix(location).iterator();

Review Comment:
   I think this is a good start but I would ask that we only make the change in v3.4 to start (we can backport level)
   
   In addition can we set this up without the early exit?
   
   Ie
   ```java
   If (table.io supportsPrefix)
    files = listPrefix()
   else
     files = listNoPrefix()
     }
     
     spark.createDataset(files)
     ```
     
     We also need a test which exercises this code path, (Does HadoopFS do this by default? If So do we have a test for the other path:noprefix)
   



-- 
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-unsubscribe@iceberg.apache.org

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


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