szehon-ho commented on code in PR #6779: URL: https://github.com/apache/iceberg/pull/6779#discussion_r1110473312
########## spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/Spark3Util.java: ########## @@ -815,9 +816,30 @@ public static String quotedFullIdentifier(String catalogName, Identifier identif * @param format format of the file * @param partitionFilter partitionFilter of the file * @return all table's partitions + * @deprecated use {@link Spark3Util#getPartitions(SparkSession, Path, String, Map, Option)} */ + @Deprecated public static List<SparkPartition> getPartitions( SparkSession spark, Path rootPath, String format, Map<String, String> partitionFilter) { + return getPartitions(spark, rootPath, format, partitionFilter, Optional.empty()); + } + + /** + * Use Spark to list all partitions in the table. + * + * @param spark a Spark session + * @param rootPath a table identifier + * @param format format of the file + * @param partitionFilter partitionFilter of the file + * @param partitionSpec partitionSpec of the table + * @return all table's partitions + */ + public static List<SparkPartition> getPartitions( + SparkSession spark, + Path rootPath, + String format, + Map<String, String> partitionFilter, + Optional<PartitionSpec> partitionSpec) { Review Comment: I was saying in original comment, Optional javadoc mentions it's usually for return value, I think in Java it's not so frequently used for arguments, and I don't think we use that in Iceberg much. So I would say, let's just make a PartitionSpec that can be null. We have the other version that takes in 4 arguments for users. -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org