Examples of cols()


Examples of io.crate.action.sql.SQLResponse.cols()

        r1.writeTo(o);

        r2 = new SQLResponse();
        r2.readFrom(new BytesStreamInput(o.bytes()));

        assertArrayEquals(r1.cols(), r2.cols());
        assertArrayEquals(r1.columnTypes(), r2.columnTypes());
        assertArrayEquals(r1.rows(), r2.rows());
        assertEquals(r1.rowCount(), r2.rowCount());
    }
View Full Code Here

Examples of io.crate.action.sql.SQLResponse.cols()

                { 0,0,2,2,4,99,111,108,49,4,99,111,108,50,0,0,0,2,0,9,114,111,119,49,95,99,111,108,49,0,9,114,111,119,49,95,99,111,108,50,0,9,114,111,119,50,95,99,111,108,49,0,9,114,111,119,50,95,99,111,108,50,0,1,0,0,0,2,4,4};
        BytesStreamInput in = new BytesStreamInput(buf, false);
        SQLResponse resp = new SQLResponse();
        resp.readFrom(in);

        assertThat(resp.cols(), is(new String[] { "col1", "col2" }));
        assertThat(resp.rows(), is(new Object[][] {
                new Object[] {"row1_col1", "row1_col2"},
                new Object[] {"row2_col1", "row2_col2"},
        }));
View Full Code Here

Examples of io.crate.action.sql.SQLResponse.cols()

                "network['tcp']['connections']['curr_established']," +
                "network['tcp']['connections']['dropped']," +
                "network['tcp']['connections']['embryonic_dropped']" +
                " from sys.nodes limit 1");
        assertThat(response.rowCount(), is(1L));
        for (int i=0; i< response.cols().length; i++) {
            assertThat((Long) response.rows()[0][i], greaterThanOrEqualTo(-1L));
        }
    }

    @Test
View Full Code Here

Examples of io.crate.action.sql.SQLResponse.cols()

                "network['tcp']['packets']['retransmitted'], " +
                "network['tcp']['packets']['errors_received'], " +
                "network['tcp']['packets']['rst_sent'] " +
                "from sys.nodes limit 1");
        assertThat(response.rowCount(), is(1L));
        for (int i = 0; i < response.cols().length; i++) {
            assertThat((Long) response.rows()[0][i], greaterThanOrEqualTo(-1L));
        }
    }

    @Test
View Full Code Here

Examples of io.crate.action.sql.SQLResponse.cols()

    @Test
    public void testSysNodesProcess() throws Exception {
        SQLResponse response = executor.exec("select process['open_file_descriptors'], " +
                "process['max_open_file_descriptors'] " +
                "from sys.nodes limit 1");
        for (int i = 0; i < response.cols().length; i++) {
            assertThat((Long) response.rows()[0][i], greaterThanOrEqualTo(-1L));
        }
    }

    @Test
View Full Code Here

Examples of io.crate.action.sql.SQLResponse.cols()

    }

    @Test
    public void testSelectDoc() throws Exception {
        SQLResponse response = executor.exec("select _doc from characters order by name desc limit 1");
        assertArrayEquals(new String[]{"_doc"}, response.cols());
        assertEquals(
                "{details={job=Mathematician}, name=Trillian, age=32, " +
                        "birthdate=276912000000, gender=female, race=Human}\n",
                TestingHelpers.printedTable(response.rows()));
    }
View Full Code Here

Examples of io.crate.action.sql.SQLResponse.cols()

    @Test
    public void testSelectStarWhereTable() throws Exception {
        SQLResponse response = transportExecutor.exec(
            "select * from sys.shards where table_name = 'characters'");
        assertEquals(10L, response.rowCount());
        assertEquals(10, response.cols().length);
    }

    @Test
    public void testSelectStarAllTables() throws Exception {
        SQLResponse response = transportExecutor.exec("select * from sys.shards");
View Full Code Here

Examples of io.crate.action.sql.SQLResponse.cols()

    @Test
    public void testSelectStarAllTables() throws Exception {
        SQLResponse response = transportExecutor.exec("select * from sys.shards");
        assertEquals(30L, response.rowCount());
        assertEquals(10, response.cols().length);
        assertEquals("schema_name, table_name, id, partition_ident, num_docs, primary, relocating_node, size, state, orphan_partition",
            Joiner.on(", ").join(response.cols()));
    }

    @Test
View Full Code Here

Examples of io.crate.action.sql.SQLResponse.cols()

    public void testSelectStarAllTables() throws Exception {
        SQLResponse response = transportExecutor.exec("select * from sys.shards");
        assertEquals(30L, response.rowCount());
        assertEquals(10, response.cols().length);
        assertEquals("schema_name, table_name, id, partition_ident, num_docs, primary, relocating_node, size, state, orphan_partition",
            Joiner.on(", ").join(response.cols()));
    }

    @Test
    public void testSelectStarLike() throws Exception {
        SQLResponse response = transportExecutor.exec(
View Full Code Here

Examples of io.crate.action.sql.SQLResponse.cols()

    @Test
    public void testSelectStarLike() throws Exception {
        SQLResponse response = transportExecutor.exec(
            "select * from sys.shards where table_name like 'charact%'");
        assertEquals(10L, response.rowCount());
        assertEquals(10, response.cols().length);
    }

    @Test
    public void testSelectStarNotLike() throws Exception {
        SQLResponse response = transportExecutor.exec(
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.