You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/09/17 20:22:22 UTC

[GitHub] [iceberg] manishmalhotrawork commented on a change in pull request #1471: RemoveOrphanFiles: consider only path to compare and delete, avoid authority and scheme

manishmalhotrawork commented on a change in pull request #1471:
URL: https://github.com/apache/iceberg/pull/1471#discussion_r490538944



##########
File path: spark/src/main/java/org/apache/iceberg/actions/RemoveOrphanFilesAction.java
##########
@@ -254,4 +270,53 @@ private static void listDirRecursively(
       return files.iterator();
     };
   }
+
+  protected static List<String> findOrphanFiles(
+      Dataset<Row> validFileDF,
+      Dataset<Row> actualFileDF) {
+    Column nameEqual = filename.apply(actualFileDF.col(RELATIVE_FILE_PATH))
+        .equalTo(filename.apply(validFileDF.col(RELATIVE_FILE_PATH)));
+
+    Column pathContains = actualFileDF.col(RELATIVE_FILE_PATH)
+        .contains(validFileDF.col(RELATIVE_FILE_PATH));
+
+    Column joinCond = nameEqual.and(pathContains);

Review comment:
       @RussellSpitzer `nameEquals` is only for fileName and does not include path. Also this condition was already there so didnt want to change it.




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

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