Examples of maxRowGranularity()


Examples of io.crate.planner.node.dql.CollectNode.maxRowGranularity()

    @Test
    public void testCollectTask() throws Exception {

        final CollectNode collectNode = new CollectNode("ei-die", CLUSTER_ROUTING);
        collectNode.maxRowGranularity(RowGranularity.CLUSTER);
        collectNode.jobId(testJobId);
        collectNode.toCollect(ImmutableList.<Symbol>of(Literal.newLiteral(4)));


        CollectOperation collectOperation = new CollectOperation() {
View Full Code Here

Examples of io.crate.planner.node.dql.CollectNode.maxRowGranularity()

    }

    @Test
    public void testCollectExpressions() throws Exception {
        CollectNode collectNode = new CollectNode("collect", testRouting);
        collectNode.maxRowGranularity(RowGranularity.NODE);
        collectNode.toCollect(Arrays.<Symbol>asList(testNodeReference));

        Object[][] result = operation.collect(collectNode).get();

        assertThat(result.length, equalTo(1));
View Full Code Here

Examples of io.crate.planner.node.dql.CollectNode.maxRowGranularity()

            put("bla", new HashMap<String, Set<Integer>>() {{
                put("my_index", Sets.newHashSet(1));
                put("my_index", Sets.newHashSet(1));
            }});
        }}));
        collectNode.maxRowGranularity(RowGranularity.DOC);
        operation.collect(collectNode);
    }

    @Test
    public void testCollectUnknownReference() throws Throwable {
View Full Code Here

Examples of io.crate.planner.node.dql.CollectNode.maxRowGranularity()

                        RowGranularity.NODE,
                        DataTypes.BOOLEAN
                )
        );
        collectNode.toCollect(Arrays.<Symbol>asList(unknownReference));
        collectNode.maxRowGranularity(RowGranularity.NODE);
        try {
            operation.collect(collectNode).get();
        } catch (ExecutionException e) {
            throw e.getCause();
        }
View Full Code Here

Examples of io.crate.planner.node.dql.CollectNode.maxRowGranularity()

        Function twoTimesTruthFunction = new Function(
                TestFunction.info,
                Arrays.<Symbol>asList(testNodeReference)
        );
        collectNode.toCollect(Arrays.<Symbol>asList(twoTimesTruthFunction, testNodeReference));
        collectNode.maxRowGranularity(RowGranularity.NODE);
        Object[][] result = operation.collect(collectNode).get();
        assertThat(result.length, equalTo(1));
        assertThat(result[0].length, equalTo(2));
        assertThat((Integer) result[0][0], equalTo(84));
        assertThat((Integer) result[0][1], equalTo(42));
View Full Code Here

Examples of io.crate.planner.node.dql.CollectNode.maxRowGranularity()

        collectNode.toCollect(Arrays.<Symbol>asList(testNodeReference));
        collectNode.whereClause(new WhereClause(new Function(
                AndOperator.INFO,
                Arrays.<Symbol>asList(Literal.newLiteral(true), Literal.newLiteral(true))
        )));
        collectNode.maxRowGranularity(RowGranularity.NODE);
        Object[][] result = operation.collect(collectNode).get();
        assertThat(result.length, equalTo(1));
        assertThat((Integer) result[0][0], equalTo(42));

    }
View Full Code Here

Examples of io.crate.planner.node.dql.CollectNode.maxRowGranularity()

    @Test
    public void testStreaming() throws Exception {

        CollectNode cn = new CollectNode("cn");
        cn.maxRowGranularity(RowGranularity.DOC);

        cn.downStreamNodes(ImmutableList.of("n1", "n2"));
        cn.toCollect(ImmutableList.<Symbol>of(new Value(DataTypes.STRING)));

View Full Code Here

Examples of io.crate.planner.node.dql.CollectNode.maxRowGranularity()

    @Test
    public void testCollectShardExpressions() throws Exception {
        CollectNode collectNode = new CollectNode("shardCollect", shardRouting(0, 1));
        collectNode.toCollect(Arrays.<Symbol>asList(testShardIdReference));
        collectNode.maxRowGranularity(RowGranularity.SHARD);
        Object[][] result = operation.collect(collectNode).get();
        assertThat(result.length, is(equalTo(2)));
        assertThat((Integer) result[0][0], isOneOf(0, 1));
        assertThat((Integer) result[1][0], isOneOf(0, 1));
View Full Code Here

Examples of io.crate.planner.node.dql.CollectNode.maxRowGranularity()

    @Test
    public void testStreamingWithJobId() throws Exception {

        CollectNode cn = new CollectNode("cn");
        cn.maxRowGranularity(RowGranularity.DOC);

        cn.downStreamNodes(ImmutableList.of("n1", "n2"));
        cn.toCollect(ImmutableList.<Symbol>of(new Value(DataTypes.STRING)));
        cn.jobId(UUID.randomUUID());
View Full Code Here

Examples of io.crate.planner.node.dql.CollectNode.maxRowGranularity()

        CollectNode collectNode = new CollectNode("shardCollect", shardRouting(0, 1));
        collectNode.toCollect(Arrays.<Symbol>asList(testShardIdReference));
        collectNode.whereClause(new WhereClause(
                new Function(op.info(), Arrays.<Symbol>asList(testShardIdReference, Literal.newLiteral(0)))));
        collectNode.maxRowGranularity(RowGranularity.SHARD);
        Object[][] result = operation.collect(collectNode).get();
        assertThat(result.length, is(equalTo(1)));
        assertThat((Integer) result[0][0], is(0));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.