KurtYoung 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_r278388563
##########
File path:
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/ReadableCatalog.java
##########
@@ -132,4 +135,60 @@
*/
boolean tableExists(ObjectPath objectPath) throws CatalogException;
+ // ------ partitions ------
+
+ /**
+ * Get CatalogPartitionSpec of all partitions of the table.
+ *
+ * @param tablePath path of the table
+ * @return a list of CatalogPartitionSpec 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<CatalogPartitionSpec> listPartitions(ObjectPath tablePath)
+ throws TableNotExistException, TableNotPartitionedException,
CatalogException;
+
+ /**
+ * Get CatalogPartitionSpec of all partitions that is under the given
CatalogPartitionSpec in the table.
+ *
+ * @param tablePath path of the table
+ * @param partitionSpec the partition spec to list
+ * @return a list of CatalogPartitionSpec that is under the given
CatalogPartitionSpec 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 PartitionSpecInvalidException thrown if the given partition
spec is invalid
+ * @throws CatalogException in case of any runtime exception
+ */
+ List<CatalogPartitionSpec> listPartitions(ObjectPath tablePath,
CatalogPartitionSpec partitionSpec)
+ throws TableNotExistException, TableNotPartitionedException,
PartitionSpecInvalidException, CatalogException;
+
+ /**
+ * Get a partition of the given table.
+ * The given partition spec keys and values need to be matched exactly
for a result.
+ *
+ * @param tablePath path of the table
+ * @param partitionSpec 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 PartitionSpecInvalidException thrown if the given partition
spec is invalid,
+ * @throws PartitionNotExistException thrown if the partition is not
partitioned
+ * @throws CatalogException in case of any runtime exception
+ */
+ CatalogPartition getPartition(ObjectPath tablePath,
CatalogPartitionSpec partitionSpec)
Review comment:
This functionality can be covered by "listPartitions"?
----------------------------------------------------------------
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