use of io.crate.planner.node.dql.join.NestedLoop in project crate by crate.
the class NestedLoopConsumerTest method testNoLimitPushDownWithJoinCondition.
@Test
public void testNoLimitPushDownWithJoinCondition() throws Exception {
NestedLoop plan = plan("select * from information_schema.tables, information_schema .columns " + "where tables.table_schema = columns.table_schema " + "and tables.table_name = columns.table_name limit 10");
assertThat(((Collect) plan.left()).collectPhase().projections().size(), is(0));
assertThat(((Collect) plan.right()).collectPhase().projections().size(), is(0));
}
use of io.crate.planner.node.dql.join.NestedLoop in project crate by crate.
the class NestedLoopConsumerTest method testAggregationOnNoMatch.
@Test
public void testAggregationOnNoMatch() throws Exception {
// shouldn't result in a NoopPlan because aggregations still need to be executed
NestedLoop nl = plan("select count(*) from users u1, users u2 where false");
assertThat(nl.nestedLoopPhase().projections(), contains(instanceOf(EvalProjection.class), instanceOf(AggregationProjection.class), instanceOf(EvalProjection.class)));
}
use of io.crate.planner.node.dql.join.NestedLoop in project crate by crate.
the class NestedLoopConsumerTest method testNoLimitPushDownWithJoinConditionOnDocTables.
@Test
public void testNoLimitPushDownWithJoinConditionOnDocTables() throws Exception {
Merge merge = plan("select u1.name, u2.name from users u1, users u2 where u1.name = u2.name order by 1, 2 limit 10");
NestedLoop nl = (NestedLoop) merge.subPlan();
assertThat(((Collect) nl.left()).collectPhase().projections().size(), is(0));
assertThat(((Collect) nl.right()).collectPhase().projections().size(), is(0));
}
use of io.crate.planner.node.dql.join.NestedLoop in project crate by crate.
the class NestedLoopConsumerTest method testGlobalAggWithWhereDoesNotResultInFilterProjection.
@Test
public void testGlobalAggWithWhereDoesNotResultInFilterProjection() throws Exception {
NestedLoop nl = plan("select min(u1.name) from users u1, users u2 where u1.name like 'A%'");
assertThat(nl.nestedLoopPhase().projections(), contains(instanceOf(EvalProjection.class), instanceOf(AggregationProjection.class), instanceOf(EvalProjection.class)));
}
use of io.crate.planner.node.dql.join.NestedLoop in project crate by crate.
the class NestedLoopConsumerTest method testOrderByPushDown.
@SuppressWarnings("ConstantConditions")
@Test
public void testOrderByPushDown() throws Exception {
QueryThenFetch qtf = plan("select u1.name, u2.name from users u1, users u2 order by u1.name");
NestedLoop nl = (NestedLoop) qtf.subPlan();
assertThat(nl.left().resultDescription(), instanceOf(Collect.class));
Collect leftPlan = (Collect) nl.left();
CollectPhase collectPhase = leftPlan.collectPhase();
assertThat(collectPhase.projections().size(), is(0));
assertThat(collectPhase.toCollect().get(0), isReference("name"));
}
Aggregations