Skip to content

Commit

Permalink
Allow RENAME TABLE TO for FileHiveMetastore
Browse files Browse the repository at this point in the history
  • Loading branch information
homar authored and ebyhr committed Sep 1, 2022
1 parent 5383462 commit cb9d67d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,8 @@ public void renameTable(ConnectorSession session, ConnectorTableHandle tableHand
DeltaLakeTableHandle handle = (DeltaLakeTableHandle) tableHandle;
Table table = metastore.getTable(handle.getSchemaName(), handle.getTableName())
.orElseThrow(() -> new TableNotFoundException(handle.getSchemaTableName()));
if (table.getTableType().equals(MANAGED_TABLE.name()) && !metastoreType.equalsIgnoreCase("glue")) {
if (table.getTableType().equals(MANAGED_TABLE.name()) &&
!(metastoreType.equalsIgnoreCase("glue") || metastoreType.equalsIgnoreCase("file"))) {
throw new TrinoException(NOT_SUPPORTED, format("Renaming managed tables is not supported for %s metastore", metastoreType));
}
metastore.renameTable(session, handle.getSchemaTableName(), newTableName);
Expand Down

0 comments on commit cb9d67d

Please sign in to comment.