bowenli86 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_r277851183
 
 

 ##########
 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. it will throw PartitionNotFoundException. I added additional javadoc for 
this behavior.
   2. will rename it

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to