Examples of maxRowGranularity()


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

    @Test
    public void testCollectShardExpressionsLiteralsAndNodeExpressions() throws Exception {
        CollectNode collectNode = new CollectNode("shardCollect", shardRouting(0, 1));
        collectNode.toCollect(Arrays.<Symbol>asList(testShardIdReference, Literal.newLiteral(true), testNodeReference));
        collectNode.maxRowGranularity(RowGranularity.SHARD);
        Object[][] result = operation.collect(collectNode).get();
        assertThat(result.length, is(equalTo(2)));
        assertThat(result[0].length, is(equalTo(3)));
        int i, j;
        if (result[0][0] == 0) {
View Full Code Here

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

        Routing routing = SysClusterTableInfo.ROUTING;
        CollectNode collectNode = new CollectNode("clusterCollect", routing);

        Reference clusterNameRef = new Reference(SysClusterTableInfo.INFOS.get(new ColumnIdent("name")));
        collectNode.toCollect(Arrays.<Symbol>asList(clusterNameRef));
        collectNode.maxRowGranularity(RowGranularity.CLUSTER);
        Object[][] result = operation.collect(collectNode).get();
        assertThat(result.length, is(1));
        assertTrue(((BytesRef) result[0][0]).utf8ToString().startsWith("shared-"));
    }
View Full Code Here

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

        Function whereClause = new Function(eqImpl.info(),
                Arrays.asList(tableNameRef, Literal.newLiteral("shards")));

        collectNode.whereClause(new WhereClause(whereClause));
        collectNode.toCollect(toCollect);
        collectNode.maxRowGranularity(RowGranularity.DOC);
        Object[][] result = operation.collect(collectNode).get();
        System.out.println(TestingHelpers.printedTable(result));
        assertEquals("sys| shards| 1| 0| NULL| NULL| NULL\n", TestingHelpers.printedTable(result));
    }
View Full Code Here

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

        List<Symbol> toCollect = new ArrayList<>();
        for (ReferenceInfo info : tableInfo.columns()) {
            toCollect.add(new Reference(info));
        }
        collectNode.toCollect(toCollect);
        collectNode.maxRowGranularity(RowGranularity.DOC);
        Object[][] result = operation.collect(collectNode).get();


        String expected = "sys| cluster| id| 1| string\n" +
                "sys| cluster| name| 2| string\n" +
View Full Code Here

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

    @Test
    public void testCollectDocLevel() throws Exception {
        CollectNode collectNode = new CollectNode("docCollect", routing(TEST_TABLE_NAME));
        collectNode.toCollect(Arrays.<Symbol>asList(testDocLevelReference, underscoreRawReference, underscoreIdReference));
        collectNode.maxRowGranularity(RowGranularity.DOC);

        Object[][] result = operation.collect(collectNode).get();
        assertThat(result.length, is(2));

        assertThat(result[0].length, is(3));
View Full Code Here

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

    public void testCollectDocLevelWhereClause() throws Exception {
        EqOperator op = (EqOperator) functions.get(new FunctionIdent(EqOperator.NAME,
                ImmutableList.<DataType>of(DataTypes.INTEGER, DataTypes.INTEGER)));
        CollectNode collectNode = new CollectNode("docCollect", routing(TEST_TABLE_NAME));
        collectNode.toCollect(Arrays.<Symbol>asList(testDocLevelReference));
        collectNode.maxRowGranularity(RowGranularity.DOC);
        collectNode.whereClause(new WhereClause(new Function(
                op.info(),
                Arrays.<Symbol>asList(testDocLevelReference, Literal.newLiteral(2)))
        ));
View Full Code Here

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

                testDocLevelReference,
                new Reference(SysNodesTableInfo.INFOS.get(new ColumnIdent("name"))),
                new Reference(SysShardsTableInfo.INFOS.get(new ColumnIdent("id"))),
                new Reference(SysClusterTableInfo.INFOS.get(new ColumnIdent("name")))
        ));
        collectNode.maxRowGranularity(RowGranularity.DOC);

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

        assertThat(result.length, is(2));
        assertThat(result[0].length, is(4));
View Full Code Here

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

                        RowGranularity.DOC, DataTypes.INTEGER)),
                new Reference(new ReferenceInfo(
                        new ReferenceIdent(tableIdent, "date"),
                        RowGranularity.SHARD, DataTypes.TIMESTAMP))
        ));
        collectNode.maxRowGranularity(RowGranularity.DOC);
        collectNode.isPartitioned(true);

        Object[][] result = operation.collect(collectNode).get();
        assertThat(result.length, is(2));
        assertThat((Integer)result[0][0], isOneOf(1,2));
View Full Code Here

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

                any(TransportResponseHandler.class));

        CollectNode collectNode = new CollectNode("dcollect", shardRouting(0, 1));
        collectNode.downStreamNodes(Arrays.asList(TEST_NODE_ID, OTHER_NODE_ID));
        collectNode.jobId(jobId);
        collectNode.maxRowGranularity(RowGranularity.SHARD);
        collectNode.toCollect(Arrays.<Symbol>asList(testShardIdReference));


        assertThat(operation.collect(collectNode).get(), is(TaskResult.EMPTY_RESULT.rows()));
        countDown.await();
View Full Code Here

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

                any(TransportResponseHandler.class));

        CollectNode collectNode = new CollectNode("dcollect", nodeRouting);
        collectNode.downStreamNodes(Arrays.asList(TEST_NODE_ID, OTHER_NODE_ID));
        collectNode.jobId(jobId);
        collectNode.maxRowGranularity(RowGranularity.NODE);
        collectNode.toCollect(Arrays.<Symbol>asList(Literal.newLiteral(true)));
        Object[][] objects = operation.collect(collectNode).get();
        assertThat((Boolean) objects[0][0], is(true));

    }
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.