xuefuz commented on a change in pull request #8222: [FLINK-11518] [table] Add
partition related catalog APIs and implement them in GenericInMemoryCatalog
URL: https://github.com/apache/flink/pull/8222#discussion_r277790658
##########
File path:
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/ReadableCatalog.java
##########
@@ -132,4 +134,58 @@
*/
boolean tableExists(ObjectPath objectPath) throws CatalogException;
+ // ------ partitions ------
+
+ /**
+ * Gets PartitionSpec of all partitions of the table.
+ *
+ * @param tablePath Path of the table.
+ * @return A list of PartitionSpec of the table.
+ *
+ * @throws TableNotExistException thrown if the table does not exist
in the catalog.
+ * @throws TableNotPartitionedException thrown if the table is
not partitioned.
+ * @throws CatalogException in case of any runtime exception
+ */
+ List<CatalogPartition.PartitionSpec> listPartitions(ObjectPath
tablePath)
+ throws TableNotExistException, TableNotPartitionedException,
CatalogException;
+
+ /**
+ * Gets PartitionSpec of all partitions that is under the given
PartitionSpec in the table .
+ *
+ * @param tablePath Path of the table
+ * @param partitionSpecs The partition spec to list
+ * @return A list of PartitionSpec that is under the given ParitionSpec
in the table.
+ *
+ * @throws TableNotExistException thrown if the table does not exist
in the catalog.
+ * @throws TableNotPartitionedException thrown if the table is
not partitioned.
+ * @throws CatalogException in case of any runtime exception
+ */
+ List<CatalogPartition.PartitionSpec> listPartitions(ObjectPath
tablePath, CatalogPartition.PartitionSpec partitionSpecs)
Review comment:
1. partitionSpecs -> partitionSpec?
2. Do we need to listPartitions()? The first version seemingly can be
replaced by the second one when partitionSpec is null or empty.
----------------------------------------------------------------
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]
With regards,
Apache Git Services