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_r277790597
##########
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)
+ throws TableNotExistException, TableNotPartitionedException,
CatalogException;
+
+ /**
+ * Gets a partition of the given table.
+ *
+ * @param tablePath Path of the table
+ * @param partitionSpecs Partition spec of partition to get
+ * @return The requested partition.
+ *
+ * @throws TableNotExistException thrown if the table does not exist
in the catalog.
+ * @throws TableNotPartitionedException thrown if the table is
not partitioned.
+ * @throws PartitionNotExistException thrown if the partition
is not partitioned.
+ * @throws CatalogException in case of any runtime exception
+ */
+ CatalogPartition getPartition(ObjectPath tablePath,
CatalogPartition.PartitionSpec partitionSpecs)
Review comment:
1. What happens if the given partitionSpec doesn't point to a single
partition (, rather, a list of partitions)?
2. partitionSpecs -> partitionSpec?
----------------------------------------------------------------
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