Package io.crate.planner.projection

Examples of io.crate.planner.projection.TopNProjection


        assertThat(chain.shardProjectors.size(), is(2));
    }

    @Test
    public void testWith2ShardProjections() throws Exception {
        TopNProjection topN = new TopNProjection(0, 1);
        GroupProjection groupProjection1 = new GroupProjection(
                Arrays.<DataTypeSymbol>asList(Literal.newLiteral(true)),
                Arrays.asList(countAggregation()));
        groupProjection1.setRequiredGranularity(RowGranularity.SHARD);
        GroupProjection groupProjection2 = new GroupProjection(
View Full Code Here


        assertThat(chain.shardProjectors.size(), is(2));
    }

    @Test
    public void testWithoutShardProjections() throws Exception {
        TopNProjection topN = new TopNProjection(0, 1);
        GroupProjection groupProjection = new GroupProjection(
                Arrays.<DataTypeSymbol>asList(Literal.newLiteral(true)),
                Arrays.asList(countAggregation()));
        ShardProjectorChain chain = new ShardProjectorChain(2, ImmutableList.of(groupProjection, topN), projectionToProjectorVisitor);
View Full Code Here

    }

    @Test
    public void testZeroShards() throws Exception {
        TopNProjection topN = new TopNProjection(0, 1);
        GroupProjection groupProjection = new GroupProjection(
                Arrays.<DataTypeSymbol>asList(Literal.newLiteral(true)),
                Arrays.asList(countAggregation()));
        ShardProjectorChain chain = new ShardProjectorChain(0, ImmutableList.of(groupProjection, topN), projectionToProjectorVisitor);
View Full Code Here

                    orderBySymbols.add(new InputColumn(node.outputs().size() + orderBySymbols.size()));
                } else {
                    orderBySymbols.add(new InputColumn(i));
                }
            }
            TopNProjection topNProjection = new TopNProjection(
                    com.google.common.base.Objects.firstNonNull(node.limit(), Constants.DEFAULT_SELECT_LIMIT),
                    node.offset(),
                    orderBySymbols,
                    node.reverseFlags(),
                    node.nullsFirst()
            );
            topNProjection.outputs(genInputColumns(node.outputs().size()));
            projectorChain = new FlatProjectorChain(
                    Arrays.<Projection>asList(topNProjection),
                    projectionToProjectorVisitor
            );
        }
View Full Code Here

TOP

Related Classes of io.crate.planner.projection.TopNProjection

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.