LakshSingla commented on code in PR #14534:
URL: https://github.com/apache/druid/pull/14534#discussion_r1259170198


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:
##########
@@ -150,16 +152,12 @@ public Response doPost(final SqlQuery sqlQuery, @Context 
final HttpServletReques
       );
       if (ExecutionMode.ASYNC != executionMode) {
         return buildNonOkResponse(
-            DruidException.forPersona(DruidException.Persona.USER)
-                          .ofCategory(DruidException.Category.INVALID_INPUT)
-                          .build(
-                              StringUtils.format(
-                                  "The statement sql api only supports sync 
mode[%s]. Please set context parameter [%s=%s] in the context payload",
-                                  ExecutionMode.ASYNC,
-                                  QueryContexts.CTX_EXECUTION_MODE,
-                                  ExecutionMode.ASYNC
-                              )
-                          )
+            InvalidInput.exception(
+                "The statement sql api only supports sync mode[%s]. Please set 
context parameter [%s=%s] in the context payload",

Review Comment:
   I went through the code, and ExecutionMode is currently unused. I have left 
it as is since I am not aware if it will be utilized later, however, I changed 
the exception to defensive since this parameter isn't supported, unset, and not 
documented, therefore it shouldn't have been set. 
   
   (cc @cryptoe, I can clean this up in case we can remove the class)



-- 
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