From 7cb3289bb75f16f82e9946869a023273cafe380d Mon Sep 17 00:00:00 2001 From: plchy2 Date: Thu, 5 Feb 2026 21:26:52 +0530 Subject: [PATCH] Fix query_timeout validation to use AnalysisException --- .../org/apache/doris/qe/SessionVariable.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) 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) {