xuefuz commented on a change in pull request #8353: [FLINK-12233][hive] Support table related operations in HiveCatalog URL: https://github.com/apache/flink/pull/8353#discussion_r281861009
########## File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java ########## @@ -85,49 +86,39 @@ public void alterDatabase(String name, CatalogDatabase newDatabase, boolean igno // ------ tables and views------ - @Override - public void dropTable(ObjectPath tablePath, boolean ignoreIfNotExists) - throws TableNotExistException, CatalogException { - throw new UnsupportedOperationException(); - } - - @Override - public void renameTable(ObjectPath tablePath, String newTableName, boolean ignoreIfNotExists) - throws TableNotExistException, TableAlreadyExistException, CatalogException { - throw new UnsupportedOperationException(); - } - @Override public void createTable(ObjectPath tablePath, CatalogBaseTable table, boolean ignoreIfExists) throws TableAlreadyExistException, DatabaseNotExistException, CatalogException { - throw new UnsupportedOperationException(); - } - @Override - public void alterTable(ObjectPath tableName, CatalogBaseTable newTable, boolean ignoreIfNotExists) - throws TableNotExistException, CatalogException { - throw new UnsupportedOperationException(); - } + validateHiveCatalogTable(table); - @Override - public List<String> listTables(String databaseName) - throws DatabaseNotExistException, CatalogException { - throw new UnsupportedOperationException(); + createHiveTable( + tablePath, + HiveCatalogUtil.createHiveTable(tablePath, table), + ignoreIfExists); } @Override - public List<String> listViews(String databaseName) throws DatabaseNotExistException, CatalogException { - throw new UnsupportedOperationException(); + public void alterTable(ObjectPath tablePath, CatalogBaseTable newTable, boolean ignoreIfNotExists) + throws TableNotExistException, CatalogException { + validateHiveCatalogTable(newTable); + + super.alterTable(tablePath, newTable, ignoreIfNotExists); } @Override - public CatalogBaseTable getTable(ObjectPath objectPath) throws TableNotExistException, CatalogException { - throw new UnsupportedOperationException(); + public CatalogBaseTable getTable(ObjectPath tablePath) Review comment: Similar comment here. I don't see we need getTable() here. getTable() is the same for both catalogs, and the only diff is the translation, which can be captured in a new API. ---------------------------------------------------------------- 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