amrishlal commented on code in PR #9236:
URL: https://github.com/apache/pinot/pull/9236#discussion_r954116254
##########
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:
This appears to be hardcoding how a query will be executed when there are
two segments. If I understand correctly there are two problems here: 1) the
result is being duplicated which is causing problem with covariance values, and
2) ability to run queries against multiple segment. I ran into the same issue
while testing a feature that I am working on. The first problem can be solved
by adding a boolean variable for not duplicating the query results. The second
(executing queries against multiple segments can be solved by local setup in
the `CovarianceQueriesTest.java`. I will share the code with you offline. Let's
see if we can do this without hardcoding for 2 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: [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]