diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java index e30207880b18b7..e4a30f472597a3 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java @@ -4841,17 +4841,22 @@ public boolean isDropTableIfCtasFailed() { return dropTableIfCtasFailed; } - public void checkQueryTimeoutValid(String newQueryTimeout) { - int value = Integer.valueOf(newQueryTimeout); - if (value <= 0) { - UnsupportedOperationException exception = - new UnsupportedOperationException( - "query_timeout can not be set to " + newQueryTimeout + ", it must be greater than 0"); - LOG.warn("Check query_timeout failed", exception); - throw exception; - } + public void checkQueryTimeoutValid(String newQueryTimeout) throws AnalysisException { + int value; + try { + value = Integer.parseInt(newQueryTimeout); + } catch (NumberFormatException e) { + throw new AnalysisException( + "query_timeout must be a positive integer, but got: " + newQueryTimeout); } + if (value <= 0) { + throw new AnalysisException( + "query_timeout must be greater than 0, but got: " + newQueryTimeout); + } +} + + public void checkMaxExecutionTimeMSValid(String newValue) { int value = Integer.valueOf(newValue); if (value < 1000) {