From 6d66949d951035ff17aaea2b93f531514f58cecf Mon Sep 17 00:00:00 2001 From: Gavin Chou Date: Thu, 23 Jan 2025 00:29:44 +0800 Subject: [PATCH 1/2] [chore](file cache) Disable show cache hotspot stmt --- .../java/org/apache/doris/analysis/ShowCacheHotSpotStmt.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowCacheHotSpotStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowCacheHotSpotStmt.java index 3fb242a89d23a5..3f85b696898f5d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowCacheHotSpotStmt.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowCacheHotSpotStmt.java @@ -113,6 +113,8 @@ public void analyze(Analyzer analyzer) throws UserException { whereExpr.add(String.format("%s = '%s' ", whereExprVariables.get(i - 1), whereExprValues.get(i))); } metaDataPos = whereExpr.size(); + throw new UserException("show cache hotspot stmt is deprecated, please use select stmt instead: " + + generateQueryString()); } @Override From 7f67e3d3818c921722a5ddbc1600a3ab1f1ed048 Mon Sep 17 00:00:00 2001 From: Gavin Chou Date: Mon, 27 Jan 2025 12:57:19 +0800 Subject: [PATCH 2/2] Add config --- .../src/main/java/org/apache/doris/common/Config.java | 4 ++++ .../org/apache/doris/analysis/ShowCacheHotSpotStmt.java | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java index 24f9bd48682557..34d9c9ba6d8bb6 100644 --- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java +++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java @@ -3327,6 +3327,10 @@ public static int metaServiceRpcRetryTimes() { "Max retry times when schema change failed in cloud model, default is 3."}) public static int schema_change_max_retry_time = 3; + @ConfField(mutable = true, description = {"是否允许使用ShowCacheHotSpotStmt语句", + "Whether to enable the use of ShowCacheHotSpotStmt, default is false."}) + public static boolean enable_show_file_cache_hotspot_stmt = false; + // ATTN: DONOT add any config not related to cloud mode here // ATTN: DONOT add any config not related to cloud mode here // ATTN: DONOT add any config not related to cloud mode here diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowCacheHotSpotStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowCacheHotSpotStmt.java index 3f85b696898f5d..d66c12104b730b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowCacheHotSpotStmt.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowCacheHotSpotStmt.java @@ -113,8 +113,11 @@ public void analyze(Analyzer analyzer) throws UserException { whereExpr.add(String.format("%s = '%s' ", whereExprVariables.get(i - 1), whereExprValues.get(i))); } metaDataPos = whereExpr.size(); - throw new UserException("show cache hotspot stmt is deprecated, please use select stmt instead: " - + generateQueryString()); + if (!Config.enable_show_file_cache_hotspot_stmt) { + LOG.info("show cache hotspot stmt is deprecated, use select stmt instead: " + generateQueryString()); + throw new UserException("show cache hotspot stmt is deprecated, please use select stmt instead: " + + generateQueryString()); + } } @Override