bowenli86 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_r284851441
########## File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java ########## @@ -200,44 +200,56 @@ protected Table createHiveTable(ObjectPath tablePath, CatalogBaseTable table) { // ------ partitions ------ @Override - public void createPartition(ObjectPath tablePath, CatalogPartitionSpec partitionSpec, CatalogPartition partition, boolean ignoreIfExists) - throws TableNotExistException, TableNotPartitionedException, PartitionSpecInvalidException, PartitionAlreadyExistsException, CatalogException { - throw new UnsupportedOperationException(); - } - - @Override - public void dropPartition(ObjectPath tablePath, CatalogPartitionSpec partitionSpec, boolean ignoreIfNotExists) - throws PartitionNotExistException, CatalogException { - throw new UnsupportedOperationException(); - } - - @Override - public void alterPartition(ObjectPath tablePath, CatalogPartitionSpec partitionSpec, CatalogPartition newPartition, boolean ignoreIfNotExists) - throws PartitionNotExistException, CatalogException { - throw new UnsupportedOperationException(); - } - - @Override - public List<CatalogPartitionSpec> listPartitions(ObjectPath tablePath) - throws TableNotExistException, TableNotPartitionedException, CatalogException { - throw new UnsupportedOperationException(); + protected void validateCatalogPartition(CatalogPartition catalogPartition) throws CatalogException { + if (!(catalogPartition instanceof HiveCatalogPartition)) { + throw new CatalogException(String.format("%s can only handle %s but got %s", getClass().getSimpleName(), + HiveCatalogPartition.class.getSimpleName(), catalogPartition.getClass().getSimpleName())); Review comment: output the full class name with `xxx.class.getName()`? ---------------------------------------------------------------- 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