Package io.crate.planner.node

Examples of io.crate.planner.node.PlanNode


    @Test
    public void testGroupByHaving() throws Exception {
        Plan plan = plan("select avg(date), name from users group by name having min(date) > '1970-01-01'");
        Iterator<PlanNode> iterator = plan.iterator();
        PlanNode planNode = iterator.next();
        assertThat(planNode, instanceOf(CollectNode.class));
        CollectNode collectNode = (CollectNode)planNode;
        assertThat(collectNode.projections().size(), is(1));
        assertThat(collectNode.projections().get(0), instanceOf(GroupProjection.class));
View Full Code Here


    @Test
    public void testInsertFromQueryWithDocAndSysColumnsMixed() throws Exception {
        Plan plan = plan("insert into users (id, name) (select id, sys.nodes.name from users)");
        Iterator<PlanNode> iterator = plan.iterator();
        PlanNode planNode = iterator.next();
        assertThat(planNode, instanceOf(CollectNode.class));

        CollectNode collectNode = (CollectNode) planNode;
        List<Symbol> toCollect = collectNode.toCollect();
        assertThat(toCollect.size(), is(2));
View Full Code Here

    @Test
    public void testInsertFromQueryWithPartitionedColumn() throws Exception {
        Plan plan = plan("insert into users (id, date) (select id, date from parted)");
        Iterator<PlanNode> iterator = plan.iterator();
        PlanNode planNode = iterator.next();
        assertThat(planNode, instanceOf(CollectNode.class));

        CollectNode collectNode = (CollectNode) planNode;
        List<Symbol> toCollect = collectNode.toCollect();
        assertThat(toCollect.size(), is(2));
View Full Code Here

    @Test
    public void testGroupByHavingInsertInto() throws Exception {
        Plan plan = plan("insert into users (id, name) (select name, count(*) from users group by name having count(*) > 3)");
        Iterator<PlanNode> iterator = plan.iterator();
        PlanNode planNode = iterator.next();
        assertThat(planNode, instanceOf(CollectNode.class));

        planNode = iterator.next();
        assertThat(planNode, instanceOf(MergeNode.class));
        MergeNode mergeNode = (MergeNode)planNode;
View Full Code Here

    @Test
    public void testGroupByHavingNonDistributed() throws Exception {
        Plan plan = plan("select id from users group by id having id > 0");
        Iterator<PlanNode> iterator = plan.iterator();
        PlanNode planNode = iterator.next();
        assertThat(planNode, instanceOf(CollectNode.class));
        CollectNode collectNode = (CollectNode)planNode;
        assertThat(collectNode.projections().size(), is(1));
        assertThat(collectNode.projections().get(0), instanceOf(GroupProjection.class));
View Full Code Here

    @Test
    public void testGlobalAggregationHaving() throws Exception {
        Plan plan = plan("select avg(date) from users having min(date) > '1970-01-01'");
        Iterator<PlanNode> iterator = plan.iterator();
        PlanNode planNode = iterator.next();
        assertThat(planNode, instanceOf(CollectNode.class));
        CollectNode collectNode = (CollectNode)planNode;
        assertThat(collectNode.projections().size(), is(1));
        assertThat(collectNode.projections().get(0), instanceOf(AggregationProjection.class));
View Full Code Here

    @Test
    public void testCountOnPartitionedTable() throws Exception {
        Plan plan = plan("select count(*) from parted");
        Iterator<PlanNode> iterator = plan.iterator();
        PlanNode planNode = iterator.next();
        assertThat(planNode, instanceOf(ESCountNode.class));
    }
View Full Code Here

TOP

Related Classes of io.crate.planner.node.PlanNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.