walterddr commented on code in PR #12211:
URL: https://github.com/apache/pinot/pull/12211#discussion_r1442365260
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotQueryResource.java:
##########
@@ -108,6 +108,9 @@ public class PinotQueryResource {
public String handlePostSql(String requestJsonStr, @Context HttpHeaders
httpHeaders) {
try {
JsonNode requestJson = JsonUtils.stringToJsonNode(requestJsonStr);
+ if (!requestJson.has("sql")) {
+ throw new IllegalStateException("JSON Payload is missing the query
string field 'sql'");
Review Comment:
should not throw IllegalStateException --> this will make the return code
500 INTERNAL_ERROR
instead we should throw a ProcessingException with a client-request error
code
e.g.
```
QueryException.getException(JSON_PARSING_ERROR_CODE, "...")
```
--
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]