Jackie-Jiang commented on code in PR #10419: URL: https://github.com/apache/pinot/pull/10419#discussion_r1139210611
########## pinot-common/src/main/java/org/apache/pinot/common/utils/config/QueryOptionsUtils.java: ########## @@ -190,4 +193,18 @@ public static Integer getGroupTrimThreshold(Map<String, String> queryOptions) { String groupByTrimThreshold = queryOptions.get(QueryOptionKey.GROUP_TRIM_THRESHOLD); return groupByTrimThreshold != null ? Integer.parseInt(groupByTrimThreshold) : null; } + + public static boolean isDropResultsEnabled(final JsonNode request) { + boolean dropResults = false; + + if (request.has(CommonConstants.Broker.Request.QUERY_OPTIONS)) { + String queryOptions = request.get(CommonConstants.Broker.Request.QUERY_OPTIONS).asText(); + Map<String, String> optionsFromString = RequestUtils.getOptionsFromString(queryOptions); + if (Boolean.parseBoolean(optionsFromString.get(CommonConstants.Broker.Request.QueryOptionKey.DROP_RESULTS))) { + dropResults = true; + } + } + + return dropResults; + } Review Comment: We want to take the `Map` here instead of the `JsonNode`. The logic of extracting the map should be on the caller side. Also suggest rename it ```suggestion public static boolean shouldDropResults(Map<String, String> queryOptions) { return Boolean.parseBoolean(queryOptions.get(CommonConstants.Broker.Request.QueryOptionKey.DROP_RESULTS)); } ``` -- 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