rdblue commented on a change in pull request #4307:
URL: https://github.com/apache/iceberg/pull/4307#discussion_r835977258
##########
File path:
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/actions/BaseDeleteOrphanFilesSparkAction.java
##########
@@ -273,4 +285,35 @@ private static void listDirRecursively(
return files.iterator();
};
}
+
+ @VisibleForTesting
+ static class PartitionAwareHiddenPathFilter implements PathFilter,
Serializable {
+
+ private final Set<String> hiddenPathPartitionNames;
+
+ PartitionAwareHiddenPathFilter(Set<String> hiddenPathPartitionNames) {
+ this.hiddenPathPartitionNames = hiddenPathPartitionNames;
+ }
+
+ @Override
+ public boolean accept(Path path) {
+ boolean isHiddenPartitionPath =
hiddenPathPartitionNames.stream().anyMatch(path.getName()::startsWith);
+ return isHiddenPartitionPath || HiddenPathFilter.get().accept(path);
+ }
+
+ static PathFilter build(Map<Integer, PartitionSpec> specs) {
Review comment:
We would normally name this method differently. `build` is usually
associated with a builder, but this is a simple factory method. For that, I
would recommend naming it `forSpecs`
--
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]