jasperjiaguo commented on code in PR #9236:
URL: https://github.com/apache/pinot/pull/9236#discussion_r954131730


##########
pinot-core/src/test/java/org/apache/pinot/queries/BaseQueriesTest.java:
##########
@@ -146,14 +160,21 @@ private BrokerResponseNative getBrokerResponse(String 
query, PlanMaker planMaker
   /**
    * Run query on multiple index segments with custom plan maker.
    * <p>Use this to test the whole flow from server to broker.
-   * <p>The result should be equivalent to querying 4 identical index segments.
+   * <p>Unless explicitly override getDistinctInstances or initialize 2 
distinct index segments in test, the result
+   * should be equivalent to querying 4 identical index segments. Otherwise, 
the result will be equivalent to
+   * querying 2 distinct instances each having 2 segments.
    */
   private BrokerResponseNative getBrokerResponse(PinotQuery pinotQuery, 
PlanMaker planMaker) {
     PinotQuery serverPinotQuery = GapfillUtils.stripGapfill(pinotQuery);
     QueryContext queryContext = 
QueryContextConverterUtils.getQueryContext(pinotQuery);
     QueryContext serverQueryContext =
         serverPinotQuery == pinotQuery ? queryContext : 
QueryContextConverterUtils.getQueryContext(serverPinotQuery);
 
+    List<List<IndexSegment>> instances = getDistinctInstances();
+    if (instances.size() == 2) {
+      return getBrokerResponseDistinctInstances(pinotQuery, planMaker);
+    }
+

Review Comment:
   @amrishlal  1) causes problem for all non-additive statistical values, e.g. 
average, standard deviation, covariance, median, percentile ... for these 
values the result querying 4 identical segments is no different from querying 
one single segment, as can be potential problematic for full functional 
testing. For 2) can you elaborate more? I think the code currently can run on 
multiple segments, but people are just setting two identical segments?



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