From 4386e8349c0258e4102e11df02d56ab043f247f4 Mon Sep 17 00:00:00 2001 From: zhangm365 Date: Thu, 12 Sep 2024 17:35:18 +0800 Subject: [PATCH] Update CatalogMgr.java --- .../main/java/org/apache/doris/datasource/CatalogMgr.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogMgr.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogMgr.java index 376bda73ffca29..63422fd3b35ab4 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogMgr.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogMgr.java @@ -238,8 +238,10 @@ private void readUnlock() { */ public void createCatalog(CreateCatalogStmt stmt) throws UserException { if (nameToCatalog.containsKey(stmt.getCatalogName())) { - LOG.warn("Catalog {} is already exist.", stmt.getCatalogName()); - throw new DdlException("Catalog had already exist with name: " + stmt.getCatalogName()); + if (stmt.isSetIfNotExists()) { + LOG.warn("Catalog {} is already exist.", stmt.getCatalogName()); + throw new DdlException("Catalog had already exist with name: " + stmt.getCatalogName()); + } } long id = Env.getCurrentEnv().getNextId();