CalciteQueryTest: Add more subquery tests. (#5880)

None of them actually work right now, but this is useful to help document,
via tests, what works and what doesn't.
This commit is contained in:
Gian Merlino 2018-06-18 11:54:29 -07:00 committed by Jonathan Wei
parent 8dc4aca25f
commit 6d0dd2fd0f

View File

@ -1800,7 +1800,10 @@ public class CalciteQueryTest extends CalciteTestBase
final List<String> queries = ImmutableList.of(
"SELECT dim1 FROM druid.foo ORDER BY dim1", // SELECT query with order by
"SELECT COUNT(*) FROM druid.foo x, druid.foo y", // Self-join
"SELECT DISTINCT dim2 FROM druid.foo ORDER BY dim2 LIMIT 2 OFFSET 5" // DISTINCT with OFFSET
"SELECT DISTINCT dim2 FROM druid.foo ORDER BY dim2 LIMIT 2 OFFSET 5", // DISTINCT with OFFSET
"SELECT COUNT(*) FROM foo WHERE dim1 NOT IN (SELECT dim1 FROM foo WHERE dim2 = 'a')", // NOT IN subquery
"EXPLAIN PLAN FOR SELECT COUNT(*) FROM foo WHERE dim1 IN (SELECT dim1 FROM foo WHERE dim2 = 'a')\n"
+ "AND dim1 IN (SELECT dim1 FROM foo WHERE m2 > 2)" // AND of two IN subqueries
);
for (final String query : queries) {