@Test public void testMultipleCountDistinctWithGroupBy() throws Exception { String query = "select n_regionkey, count(distinct n_nationkey), count(distinct n_name) from cp.\"tpch/nation.parquet\" group by n_regionkey;"; try( AutoCloseable ac1 = withOption(PlannerSettings.HASHAGG, false); AutoCloseable ac2 = withOption(PlannerSettings.STREAMAGG, true); ){ test(query); try(AutoCloseable ac3 = withOption(ExecConstants.SLICE_TARGET_OPTION, 1)){ test(query); } } try( AutoCloseable ac1 = withOption(PlannerSettings.HASHAGG, true); AutoCloseable ac2 = withOption(PlannerSettings.STREAMAGG, false); ){ test(query); try(AutoCloseable ac3 = withOption(ExecConstants.SLICE_TARGET_OPTION, 1)){ test(query); } } }
@Test // DRILL-1846 (this tests issue with SimpleMergeExchange) public void testOrderByDiffColumnsInSubqAndOuter() throws Exception { String query = "select n.n_nationkey from (select n_nationkey, n_regionkey from cp.\"tpch/nation.parquet\" order by n_regionkey) n order by n.n_nationkey"; // set slice_target = 1 to force exchanges try(AutoCloseable ac = withOption(ExecConstants.SLICE_TARGET_OPTION, 1)){ test(query); } }
@Test // DRILL-1561 public void test2PhaseAggAfterOrderBy() throws Exception { String query = "select count(*) from (select o_custkey from cp.\"tpch/orders.parquet\" order by o_custkey)"; // set slice_target = 1 to force exchanges and 2-phase aggregation try(AutoCloseable ac = withOption(ExecConstants.SLICE_TARGET_OPTION, 1)){ test(query); } }
@Test // DRILL-1846 (this tests issue with UnionExchange) @Ignore("DRILL-1866") public void testLimitInSubqAndOrderByOuter() throws Exception { String query = "select t2.n_nationkey from (select n_nationkey, n_regionkey from cp.\"tpch/nation.parquet\" t1 group by n_nationkey, n_regionkey limit 10) t2 order by t2.n_nationkey"; // set slice_target = 1 to force exchanges try(AutoCloseable ac = withOption(ExecConstants.SLICE_TARGET_OPTION, 1)){ test(query); } }
@Test @Ignore() public void testJoinMerge() throws Exception { try(AutoCloseable option = withOption(PlannerSettings.HASHJOIN, false)){ test("select count(*) \n" + " from (select l.l_orderkey as x, c.c_custkey as y \n" + " from cp.\"tpch/lineitem.parquet\" l \n" + " left outer join cp.\"tpch/customer.parquet\" c \n" + " on l.l_orderkey = c.c_custkey) as foo\n" + " where x < 10000\n" + ""); } }
@Test @Ignore("DRILL-3004") public void testJoin() throws Exception { try(AutoCloseable ac = withOption(PlannerSettings.HASHJOIN, false)){ test("SELECT\n" + " nations.N_NAME,\n" + " regions.R_NAME\n" + "FROM\n" + " cp.\"tpch/nation.parquet\" nations\n" + "JOIN\n" + " cp.\"tpch/region.parquet\" regions\n" + " on nations.N_REGIONKEY = regions.R_REGIONKEY where 1 = 0"); } }