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 a7e781dd2a4a9a..46a1b8540a1954 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 @@ -3233,6 +3233,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 cf978033d796d7..c6dc1fe4d7ad39 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,11 @@ public void analyze(Analyzer analyzer) throws UserException { whereExpr.add(String.format("%s = '%s' ", whereExprVariables.get(i - 1), whereExprValues.get(i))); } metaDataPos = whereExpr.size(); + 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