use of io.crate.testing.SQLResponse in project crate by crate.
the class SysOperationsTest method testDistinctSysOperations.
@Test
public void testDistinctSysOperations() throws Exception {
// this tests a distributing collect without shards but DOC level granularity
SQLResponse response = execute("select distinct name from sys.operations limit 1");
assertThat(response.rowCount(), is(1L));
}
use of io.crate.testing.SQLResponse in project crate by crate.
the class SysShardsTest method testSelectGroupByWhereTable.
@Test
public void testSelectGroupByWhereTable() throws Exception {
SQLResponse response = execute("" + "select count(*), num_docs from sys.shards where table_name = 'characters' " + "group by num_docs order by count(*)");
assertThat(response.rowCount(), greaterThan(0L));
}
use of io.crate.testing.SQLResponse in project crate by crate.
the class SysShardsTest method testSelectStarIn.
@Test
public void testSelectStarIn() throws Exception {
SQLResponse response = execute("select * from sys.shards where table_name in ('characters')");
assertEquals(8L, response.rowCount());
assertEquals(15, response.cols().length);
}
use of io.crate.testing.SQLResponse in project crate by crate.
the class SysShardsTest method testSelectStarAllTables.
@Test
public void testSelectStarAllTables() throws Exception {
SQLResponse response = execute("select * from sys.shards");
assertEquals(26L, response.rowCount());
assertEquals(15, response.cols().length);
assertThat(response.cols(), arrayContaining("blob_path", "id", "min_lucene_version", "num_docs", "orphan_partition", "partition_ident", "path", "primary", "recovery", "relocating_node", "routing_state", "schema_name", "size", "state", "table_name"));
}
use of io.crate.testing.SQLResponse in project crate by crate.
the class SysShardsTest method testSelectGlobalCount.
@Test
public void testSelectGlobalCount() throws Exception {
SQLResponse response = execute("select count(*) from sys.shards");
assertEquals(1L, response.rowCount());
assertEquals(26L, response.rows()[0][0]);
}
Aggregations