aokolnychyi commented on a change in pull request #2210:
URL: https://github.com/apache/iceberg/pull/2210#discussion_r590992124
##########
File path: spark/src/main/java/org/apache/iceberg/spark/SparkTableUtil.java
##########
@@ -621,6 +640,32 @@ public static void importSparkPartitions(
}
}
+ public static List<SparkPartition> filterPartitions(List<SparkPartition>
partitions,
+ Map<String, String>
partitionFilter) {
+ if (partitionFilter.isEmpty()) {
+ // No partition filter arg
+
+ if (partitions.isEmpty()) {
+ throw new IllegalArgumentException("Cannot add files, no files found
in the table.");
Review comment:
I feel like this should be checked outside of `filterPartitions`. I
think this utility method should focus only on filtering passed partitions.
Also, I think the error message can be a bit more precise. In this case, we did
not find partitions for a partitioned table rather than did not find files.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]