Jackie-Jiang commented on code in PR #11383: URL: https://github.com/apache/pinot/pull/11383#discussion_r1298791276
########## pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MultiStageEngineIntegrationTest.java: ########## @@ -101,6 +101,23 @@ public void testHardcodedQueries() super.testHardcodedQueries(); } + @Test + public void testSingleValueQuery() + throws Exception { + String query = "select sum(ActualElapsedTime) from mytable WHERE ActualElapsedTime > \n" + + "(select avg(ActualElapsedTime) as avg_profit from mytable) \n"; Review Comment: ```suggestion String query = "select sum(ActualElapsedTime) from mytable WHERE ActualElapsedTime > " + "(select avg(ActualElapsedTime) as avg_profit from mytable)"; ``` ########## pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MultiStageEngineIntegrationTest.java: ########## @@ -101,6 +101,23 @@ public void testHardcodedQueries() super.testHardcodedQueries(); } + @Test + public void testSingleValueQuery() + throws Exception { + String query = "select sum(ActualElapsedTime) from mytable WHERE ActualElapsedTime > \n" + + "(select avg(ActualElapsedTime) as avg_profit from mytable) \n"; + JsonNode jsonNode = postQuery(query); + long joinResult = jsonNode.get("resultTable").get("rows").get(0).get(0).asLong(); + System.out.println("jsonNode = " + jsonNode); + + // The query of `SELECT avg(ActualElapsedTime) FROM mytable` is -1412.435033969449 + query = "select sum(ActualElapsedTime) as profit from mytable WHERE ActualElapsedTime > -1412.435033969449 \n"; Review Comment: ```suggestion query = "select sum(ActualElapsedTime) as profit from mytable WHERE ActualElapsedTime > -1412.435033969449"; ``` ########## pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MultiStageEngineIntegrationTest.java: ########## @@ -101,6 +101,23 @@ public void testHardcodedQueries() super.testHardcodedQueries(); } + @Test + public void testSingleValueQuery() + throws Exception { + String query = "select sum(ActualElapsedTime) from mytable WHERE ActualElapsedTime > \n" + + "(select avg(ActualElapsedTime) as avg_profit from mytable) \n"; + JsonNode jsonNode = postQuery(query); + long joinResult = jsonNode.get("resultTable").get("rows").get(0).get(0).asLong(); + System.out.println("jsonNode = " + jsonNode); + + // The query of `SELECT avg(ActualElapsedTime) FROM mytable` is -1412.435033969449 + query = "select sum(ActualElapsedTime) as profit from mytable WHERE ActualElapsedTime > -1412.435033969449 \n"; + jsonNode = postQuery(query); + System.out.println("jsonNode = " + jsonNode); Review Comment: Remove ########## pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MultiStageEngineIntegrationTest.java: ########## @@ -101,6 +101,23 @@ public void testHardcodedQueries() super.testHardcodedQueries(); } + @Test + public void testSingleValueQuery() + throws Exception { + String query = "select sum(ActualElapsedTime) from mytable WHERE ActualElapsedTime > \n" + + "(select avg(ActualElapsedTime) as avg_profit from mytable) \n"; + JsonNode jsonNode = postQuery(query); + long joinResult = jsonNode.get("resultTable").get("rows").get(0).get(0).asLong(); + System.out.println("jsonNode = " + jsonNode); Review Comment: Remove ########## pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MultiStageEngineIntegrationTest.java: ########## @@ -101,6 +101,23 @@ public void testHardcodedQueries() super.testHardcodedQueries(); } + @Test + public void testSingleValueQuery() + throws Exception { + String query = "select sum(ActualElapsedTime) from mytable WHERE ActualElapsedTime > \n" + + "(select avg(ActualElapsedTime) as avg_profit from mytable) \n"; + JsonNode jsonNode = postQuery(query); Review Comment: Can we compare with H2 result? -- 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