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_r281860485
##########
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);
Review comment:
Similar to createTable(), I don't see we need to provide implementations for
alterTable() in each subclass because I don't really see much difference. If
validation is different, then we can define a new interface in the base and
have each subclass implement it.
----------------------------------------------------------------
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