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

[GitHub] [pinot] xiangfu0 commented on a diff in pull request #11048: [multistage] Register Pinot Transform Functions into Calcite

xiangfu0 commented on code in PR #11048:
URL: https://github.com/apache/pinot/pull/11048#discussion_r1254983729


##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/JsonPathClusterIntegrationTest.java:
##########
@@ -260,15 +260,19 @@ public void testComplexQueries()
       Assert.assertEquals(k4.get("k4-k3"), "value-k4-k3-" + seqId);
       Assert.assertEquals(Double.parseDouble(k4.get("met").toString()), Double.parseDouble(seqId));
     }
+  }
 
+  @Test
+  public void testComplexQueries2()
+      throws Exception {
     //Group By Query
-    query = "Select" + " jsonExtractScalar(complexMapStr,'$.k1','STRING'),"
+    String query = "Select" + " jsonExtractScalar(complexMapStr,'$.k1','STRING'),"
         + " sum(jsonExtractScalar(complexMapStr,'$.k4.met','INT'))" + " from " + DEFAULT_TABLE_NAME
         + " group by jsonExtractScalar(complexMapStr,'$.k1','STRING')"
         + " order by sum(jsonExtractScalar(complexMapStr,'$.k4.met','INT')) DESC";
-    pinotResponse = postQuery(query);
+    JsonNode pinotResponse = postQuery(query);
     Assert.assertNotNull(pinotResponse.get("resultTable").get("rows"));
-    rows = (ArrayNode) pinotResponse.get("resultTable").get("rows");
+    ArrayNode rows = (ArrayNode) pinotResponse.get("resultTable").get("rows");
     for (int i = 0; i < rows.size(); i++) {
       String seqId = _sortedSequenceIds.get(NUM_TOTAL_DOCS - 1 - i);

Review Comment:
   Actually V1 results is wrong, when it's order by `sum(jsonExtractScalar(complexMapStr,'$.k4.met','INT'))`, the result is not in order of numbers, but lex.



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