siddharthteotia commented on code in PR #11710:
URL: https://github.com/apache/pinot/pull/11710#discussion_r1341681228


##########
pinot-core/src/main/java/org/apache/pinot/core/query/scheduler/QueryScheduler.java:
##########
@@ -168,6 +169,19 @@ protected byte[] 
processQueryAndSerialize(ServerQueryRequest queryRequest, Execu
 
       byte[] responseBytes = serializeResponse(queryRequest, instanceResponse);
 
+      Map<String, String> queryOptions = 
queryRequest.getQueryContext().getQueryOptions();
+      Long maxResponseByteLength = 
QueryOptionsUtils.getMaxSerializedResponseLengthPerServer(queryOptions);
+      if (maxResponseByteLength != null && responseBytes.length > 
maxResponseByteLength) {

Review Comment:
   Is it better to do this sooner as the serialized response is being built ? 
There is a method that converts DataTable into toBytes(). The method does 
incrementally by going over various data structures in the DataTable. Ideally 
we can intersperse this check within that method at various points ?
   
   On a related note, is it possible to do this check as segment level 
individual result is being combined by the CombineOperator ?



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to