lirui-apache commented on a change in pull request #8449: [FLINK-12235][hive] Support partition related operations in HiveCatalog URL: https://github.com/apache/flink/pull/8449#discussion_r284968075
########## File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/GenericInMemoryCatalog.java ########## @@ -412,31 +418,22 @@ public void createPartition(ObjectPath tablePath, CatalogPartitionSpec partition checkNotNull(partitionSpec); checkNotNull(partition); - if (!tableExists(tablePath)) { - throw new TableNotExistException(catalogName, tablePath); - } - - if (!isPartitionedTable(tablePath)) { - throw new TableNotPartitionedException(catalogName, tablePath); - } + ensureTableExists(tablePath); + ensurePartitionedTable(tablePath); + ensureFullPartitionSpec(tablePath, partitionSpec); if (partitionExists(tablePath, partitionSpec)) { if (!ignoreIfExists) { throw new PartitionAlreadyExistsException(catalogName, tablePath, partitionSpec); } } - if (!isPartitionSpecValid(tablePath, partitionSpec)) { - throw new PartitionSpecInvalidException(catalogName, ((CatalogTable) getTable(tablePath)).getPartitionKeys(), - tablePath, partitionSpec); - } - partitions.get(tablePath).put(partitionSpec, partition.copy()); } @Override public void dropPartition(ObjectPath tablePath, CatalogPartitionSpec partitionSpec, boolean ignoreIfNotExists) - throws PartitionNotExistException, CatalogException { + throws PartitionNotExistException, CatalogException { Review comment: Thanks for pointing out, will do ---------------------------------------------------------------- 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