xuefuz commented on a change in pull request #8720: [FLINK-12771][hive] Support
ConnectorCatalogTable in HiveCatalog
URL: https://github.com/apache/flink/pull/8720#discussion_r293600489
##########
File path:
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
##########
@@ -332,11 +359,24 @@ public void renameTable(ObjectPath tablePath, String
newTableName, boolean ignor
checkNotNull(tablePath, "tablePath cannot be null");
checkArgument(!StringUtils.isNullOrWhitespaceOnly(newTableName), "newTableName
cannot be null or empty");
+ ObjectPath newPath = new
ObjectPath(tablePath.getDatabaseName(), newTableName);
+
+ ConnectorCatalogTable connectorTable =
connectorTables.remove(tablePath);
+
+ if (connectorTable != null) {
+ if (connectorTables.containsKey(newPath)) {
+ throw new TableAlreadyExistException(getName(),
newPath);
Review comment:
If we get here because of this exception, the table is already dropped,
which doesn't seem right.
----------------------------------------------------------------
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