kfaraz commented on code in PR #12680:
URL: https://github.com/apache/druid/pull/12680#discussion_r902766104


##########
processing/src/main/java/org/apache/druid/query/scan/ScanQueryRunnerFactory.java:
##########
@@ -92,11 +93,15 @@ public QueryRunner<ScanResultValue> mergeRunners(
       ScanQuery query = (ScanQuery) queryPlus.getQuery();
       ScanQuery.verifyOrderByForNativeExecution(query);
 
-      // Note: this variable is effective only when queryContext has a timeout.
-      // See the comment of ResponseContext.Key.TIMEOUT_AT.
-      final long timeoutAt = System.currentTimeMillis() + 
QueryContexts.getTimeout(queryPlus.getQuery());
-      responseContext.putTimeoutTime(timeoutAt);
-
+      try {
+        // Note: this variable is effective only when queryContext has a 
timeout.
+        // See the comment of ResponseContext.Key.TIMEOUT_AT.
+        final long timeoutAt = System.currentTimeMillis() + 
QueryContexts.getTimeout(queryPlus.getQuery());
+        responseContext.putTimeoutTime(timeoutAt);
+      }
+      catch (NumberFormatException e) {
+        throw new BadQueryContextException(e);

Review Comment:
   Maybe this exception should be thrown by the `QueryContexts.getTimeout()` 
method itself? I don't see why every caller should have to catch a 
`NumberFormatException`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to