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_r278416188
########## File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/ReadableWritableCatalog.java ########## @@ -131,4 +137,62 @@ void createTable(ObjectPath tablePath, CatalogBaseTable table, boolean ignoreIfE void alterTable(ObjectPath tableName, CatalogBaseTable newTable, boolean ignoreIfNotExists) throws TableNotExistException, CatalogException; + // ------ partitions ------ + + /** + * Create a partition. + * + * @param tablePath path of the table. + * @param partitionSpec partition spec of the partition + * @param partition the partition to add. + * @param ignoreIfExists flag to specify behavior if a table with the given name already exists: + * if set to false, it throws a TableAlreadyExistException, + * if set to true, nothing happens. + * + * @throws TableNotExistException thrown if the target table does not exist + * @throws TableNotPartitionedException thrown if the target table is not partitioned + * @throws PartitionSpecInvalidException thrown if the given partition spec is invalid + * @throws PartitionAlreadyExistsException thrown if the target partition already exists + * @throws CatalogException in case of any runtime exception + */ + void createPartition(ObjectPath tablePath, CatalogPartitionSpec partitionSpec, CatalogPartition partition, boolean ignoreIfExists) Review comment: An example from a SQL perspective is "ALTER TABLE ADD PARTITION". Operations on partitions will be using and only using table as an identifier to locate the partition, and that's why this API includes tablePath. ---------------------------------------------------------------- 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