xuefuz commented on a change in pull request #8312: [FLINK-12366][table] Clean
up Catalog APIs to make them more consiste…
URL: https://github.com/apache/flink/pull/8312#discussion_r279961356
##########
File path:
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/ReadableCatalog.java
##########
@@ -174,14 +172,11 @@
* @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)
- throws TableNotExistException, TableNotPartitionedException,
PartitionSpecInvalidException, PartitionNotExistException, CatalogException;
+ throws PartitionNotExistException, CatalogException;
Review comment:
In short, partition not existing includes the case of table not existing.
getPartition() attempts to get a specific partition for a table. If the table
doesn't exist, then of course, the partition doesn't exist.
On the other hand, listPartition() fails (throws an exception) if the table
doesn't exist, which is reasonable.
Just like getTable(), which doesn't throw databasenotexistEx when db doesn't
exist. The change makes the behavior consistent across board.
----------------------------------------------------------------
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