From dfb60c11ff8c019a8d11f2fb354dcf3d200c7713 Mon Sep 17 00:00:00 2001 From: zombee0 Date: Thu, 13 Feb 2025 20:40:06 +0800 Subject: [PATCH] [BugFix]Drop inexistent table silently Signed-off-by: zombee0 --- .../java/com/starrocks/connector/hive/HiveMetadata.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/com/starrocks/connector/hive/HiveMetadata.java b/fe/fe-core/src/main/java/com/starrocks/connector/hive/HiveMetadata.java index 48c45afdbd936..9882d3105aa36 100644 --- a/fe/fe-core/src/main/java/com/starrocks/connector/hive/HiveMetadata.java +++ b/fe/fe-core/src/main/java/com/starrocks/connector/hive/HiveMetadata.java @@ -173,7 +173,13 @@ public void dropTable(DropTableStmt stmt) throws DdlException { hmsTable.getDbName(), hmsTable.getTableName(), hmsTable.getTableLocation())); } } else { - HiveTable hiveTable = (HiveTable) getTable(dbName, tableName); + HiveTable hiveTable = null; + try { + hiveTable = (HiveTable) getTable(dbName, tableName); + } catch (Exception e) { + // ignore not found exception, we need keep this catch, + // otherwise it throws exception when we `drop if exists`. + } if (hiveTable == null && stmt.isSetIfExists()) { LOG.warn("Table {}.{} doesn't exist", dbName, tableName); return;