This is an automated email from the ASF dual-hosted git repository.

rongr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new d05e3bd05c [bugfix] Handle NPE in controller SQL Resource (#12211)
d05e3bd05c is described below

commit d05e3bd05ce88360f06b809c4bbde871efafea4a
Author: Eaugene Thomas <[email protected]>
AuthorDate: Tue Jan 9 22:55:27 2024 +0530

    [bugfix] Handle NPE in controller SQL Resource (#12211)
    
    * Handle NPE in controller SQL Resource
---
 .../org/apache/pinot/controller/api/resources/PinotQueryResource.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotQueryResource.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotQueryResource.java
index 90f75760be..077971ef72 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotQueryResource.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotQueryResource.java
@@ -108,6 +108,10 @@ public class PinotQueryResource {
   public String handlePostSql(String requestJsonStr, @Context HttpHeaders 
httpHeaders) {
     try {
       JsonNode requestJson = JsonUtils.stringToJsonNode(requestJsonStr);
+      if (!requestJson.has("sql")) {
+        return 
constructQueryExceptionResponse(QueryException.getException(QueryException.JSON_PARSING_ERROR,
+                "JSON Payload is missing the query string field 'sql'"));
+      }
       String sqlQuery = requestJson.get("sql").asText();
       String traceEnabled = "false";
       if (requestJson.has("trace")) {


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

Reply via email to