Skip to content

Commit ca9055e

Browse files
committed
Ignore non-existing table when dropping Iceberg schema with cascade
1 parent d5ad905 commit ca9055e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,10 @@ public void dropSchema(ConnectorSession session, String schemaName, boolean casc
11711171
dropView(session, viewName);
11721172
}
11731173
for (SchemaTableName tableName : listTables(session, Optional.of(schemaName))) {
1174-
dropTable(session, getTableHandle(session, tableName, Optional.empty(), Optional.empty()));
1174+
ConnectorTableHandle tableHandle = getTableHandle(session, tableName, Optional.empty(), Optional.empty());
1175+
if (tableHandle != null) {
1176+
dropTable(session, tableHandle);
1177+
}
11751178
}
11761179
}
11771180
catalog.dropNamespace(session, schemaName);

0 commit comments

Comments
 (0)