gianm commented on a change in pull request #8775: Fix NPE for subquery with limit URL: https://github.com/apache/incubator-druid/pull/8775#discussion_r341271916
########## File path: sql/src/test/java/org/apache/druid/sql/calcite/http/SqlResourceTest.java ########## @@ -671,6 +671,46 @@ public void testResourceLimitExceeded() throws Exception checkSqlRequestLog(false); } + @Test + public void testSubQueryWithLimit() throws Exception + { + final List<Map<String, Object>> rows = doPost( + new SqlQuery( + "SELECT COUNT(*) AS cnt FROM ( SELECT * FROM ( SELECT * FROM druid.foo LIMIT 10 ) tmpA ) tmpB", + null, + false, + null + ) + ).rhs; + + Assert.assertEquals( + ImmutableList.of(), + rows + ); + checkSqlRequestLog(true); + } + + @Test + public void testSubQueryWithoutLimit() throws Exception Review comment: Could you move these tests into `CalciteQueryTest` please? Its `testQuery` method provides a nice way to test this stuff, including testing that it plans into an appropriate native query. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org