walterddr commented on code in PR #11216:
URL: https://github.com/apache/pinot/pull/11216#discussion_r1279587937
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MultiStageEngineIntegrationTest.java:
##########
@@ -128,12 +128,55 @@ public void testMultiValueColumnSelectionQuery()
testQueryWithMatchingRowCount(pinotQuery, h2Query);
}
+ @Test(dataProvider = "useBothQueryEngines")
+ public void testMultiValueColumnAggregationQuery(boolean
useMultiStageQueryEngine)
+ throws Exception {
+ setUseMultiStageQueryEngine(useMultiStageQueryEngine);
+
+ String[] multiValueFunctions = new String[]{
+ "sumMV", "countMV", "minMV", "maxMV", "avgMV", "minMaxRangeMV",
"distinctCountMV", "distinctCountBitmapMV",
+ "distinctCountHLLMV", "distinctSumMV", "distinctAvgMV"
+ };
+ double[] expectedResults = new double[]{
+ -5.421344202E9, 577725, -9999.0, 16271.0, -9383.95292223809, 26270.0,
312, 312, 328, 3954484.0,
+ 12674.628205128205
+ };
+
+ Assert.assertEquals(multiValueFunctions.length, expectedResults.length);
+
+ for (int i = 0; i < multiValueFunctions.length; i++) {
+ String pinotQuery = String.format("SELECT %s(DivAirportIDs) FROM
mytable", multiValueFunctions[i]);
+ JsonNode jsonNode = postQuery(pinotQuery);
+
Assert.assertEquals(jsonNode.get("resultTable").get("rows").get(0).get(0).asDouble(),
expectedResults[i]);
+ }
+
+ String pinotQuery = "SELECT percentileMV(DivAirportIDs, 99) FROM mytable";
+ JsonNode jsonNode = postQuery(pinotQuery);
+
Assert.assertEquals(jsonNode.get("resultTable").get("rows").get(0).get(0).asDouble(),
13433.0);
+
+ pinotQuery = "SELECT percentileEstMV(DivAirportIDs, 99) FROM mytable";
+ jsonNode = postQuery(pinotQuery);
+
Assert.assertTrue(jsonNode.get("resultTable").get("rows").get(0).get(0).asDouble()
> 13000);
+
Assert.assertTrue(jsonNode.get("resultTable").get("rows").get(0).get(0).asDouble()
< 14000);
+
+ pinotQuery = "SELECT percentileTDigestMV(DivAirportIDs, 99) FROM mytable";
+ jsonNode = postQuery(pinotQuery);
+
Assert.assertTrue(jsonNode.get("resultTable").get("rows").get(0).get(0).asDouble()
> 13000);
+
Assert.assertTrue(jsonNode.get("resultTable").get("rows").get(0).get(0).asDouble()
< 14000);
+
+ pinotQuery = "SELECT percentileKLLMV(DivAirportIDs, 99) FROM mytable";
Review Comment:
can we add tests for both the 2 and 3 arg version of the same function
(same applies to other functions)
--
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]