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 3fb242a89d23a5..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,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