shauryachats commented on code in PR #16641:
URL: https://github.com/apache/pinot/pull/16641#discussion_r2307952153


##########
pinot-broker/src/main/java/org/apache/pinot/broker/api/resources/PinotClientRequest.java:
##########
@@ -295,10 +298,12 @@ public void processTimeSeriesQueryEngine(Map<String, 
String> queryParams, @Suspe
       String language = queryParams.get(Request.LANGUAGE);
       String queryString = queryParams.get(Request.QUERY);
       try (RequestScope requestContext = 
Tracing.getTracer().createRequestScope()) {
-        PinotBrokerTimeSeriesResponse response = 
executeTimeSeriesQuery(language, queryString, queryParams,
+        TimeSeriesBlock timeSeriesBlock = executeTimeSeriesQuery(language, 
queryString, queryParams,
             requestContext, makeHttpIdentity(requestCtx), httpHeaders);
-        asyncResponse.resume(response.toBrokerResponse());
+        
asyncResponse.resume(TimeSeriesResponseMapper.toBrokerResponse(timeSeriesBlock));
       }
+    } catch (QueryException e) {
+      asyncResponse.resume(TimeSeriesResponseMapper.toBrokerResponse(e));
     } catch (Exception e) {
       LOGGER.error("Caught exception while processing POST timeseries 
request", e);
       
_brokerMetrics.addMeteredGlobalValue(BrokerMeter.UNCAUGHT_POST_EXCEPTIONS, 1L);

Review Comment:
   I see that the current `POST /query/sql` also throws a 
`WebApplicationException` in case of any unexpected exception thrown, and I 
kept this to keep it consistent. Since the status code is not 2xx here, should 
we still cast the exception to a `BrokerResponse`?



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