From 3f126fdd6302590290dcb2bc5dc5c4efc2c296db Mon Sep 17 00:00:00 2001 From: caiconghui <55968745+caiconghui@users.noreply.github.com> Date: Sun, 18 Feb 2024 16:33:41 +0800 Subject: [PATCH] [fix](repository) fix NullPointerException when execute create repository statement without properties (#30972) Co-authored-by: caiconghui1 --- fe/fe-core/src/main/cup/sql_parser.cup | 4 ++-- .../java/org/apache/doris/analysis/RefreshCatalogStmt.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/cup/sql_parser.cup b/fe/fe-core/src/main/cup/sql_parser.cup index 3893343ebb..ec3bba7996 100644 --- a/fe/fe-core/src/main/cup/sql_parser.cup +++ b/fe/fe-core/src/main/cup/sql_parser.cup @@ -3505,7 +3505,7 @@ key_value_map ::= opt_properties ::= {: - RESULT = null; + RESULT = Maps.newHashMap(); :} | properties:properties {: @@ -3644,7 +3644,7 @@ opt_actions ::= opt_ext_properties ::= {: - RESULT = null; + RESULT = Maps.newHashMap(); :} | KW_BROKER properties:properties {: diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/RefreshCatalogStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/RefreshCatalogStmt.java index 006eebe44b..a2e5930d14 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/RefreshCatalogStmt.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/RefreshCatalogStmt.java @@ -73,7 +73,8 @@ public class RefreshCatalogStmt extends DdlStmt { } // Set to false only if user set the property "invalid_cache"="false" - invalidCache = !(properties != null && properties.get(INVALID_CACHE).equalsIgnoreCase("false")); + invalidCache = !(properties.get(INVALID_CACHE) != null && properties.get(INVALID_CACHE) + .equalsIgnoreCase("false")); } @Override