You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "walterddr (via GitHub)" <gi...@apache.org> on 2023/07/21 15:30:38 UTC

[GitHub] [pinot] walterddr commented on a diff in pull request #11117: [multistage] bridge v2 query engine for leaf stage v1 multi-value column

walterddr commented on code in PR #11117:
URL: https://github.com/apache/pinot/pull/11117#discussion_r1270810293


##########
pinot-common/src/main/java/org/apache/pinot/common/function/TransformFunctionType.java:
##########
@@ -90,6 +90,11 @@ public enum TransformFunctionType {
   // date type conversion functions
   CAST("cast"),
 
+  // object type
+  ARRAY_TO_MV("arrayToMV",

Review Comment:
   IMO this is confusing name. the data type is already MV running an ARRAY_TO_MV is a bit weird. 
   should we named it `USE_AS_MV`? and we can say that MV columns are by default `USE_AS_ARRAY`



##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MultiStageEngineIntegrationTest.java:
##########
@@ -485,6 +486,25 @@ public void testLiteralOnlyFunc()
     assertEquals(results.get(10).asText(), "hello!");
   }
 
+  @Test
+  public void testMultiValueColumnGroupBy()
+      throws Exception {
+    String pinotQuery = "SELECT count(*), arrayToMV(RandomAirports) FROM mytable "
+        + "GROUP BY arrayToMV(RandomAirports)";
+    JsonNode jsonNode = postQuery(pinotQuery);
+    Assert.assertEquals(jsonNode.get("resultTable").get("rows").size(), 154);
+  }
+
+  @Test
+  public void testMultiValueColumnGroupByOrderBy()
+      throws Exception {
+    String pinotQuery = "SELECT count(*), arrayToMV(RandomAirports) FROM mytable "

Review Comment:
   will it work if I run 
   ```
   SELECT count(*), arrayToMV(RandomAirports) 
   FROM mytable 
   WHERE Dest IN (SELECT Dest FROM myTable GROUP BY Dest HAVING count(*) > 10)
   ```
   (later when we implemented the scalar function wrapper)



##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MultiStageEngineIntegrationTest.java:
##########
@@ -485,6 +486,25 @@ public void testLiteralOnlyFunc()
     assertEquals(results.get(10).asText(), "hello!");
   }
 
+  @Test
+  public void testMultiValueColumnGroupBy()
+      throws Exception {
+    String pinotQuery = "SELECT count(*), arrayToMV(RandomAirports) FROM mytable "

Review Comment:
   BaseIntegrationTestSets also have (1) hard-coded MV tests queries; and (2) withMultiValue flag in generated queries
   should we turn them on?



-- 
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-unsubscribe@pinot.apache.org

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


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