use of io.prestodb.tempto.query.QueryResult in project presto by prestodb.
the class TestRoles method testListRoles.
@Test(groups = { ROLES, AUTHORIZATION, PROFILE_SPECIFIC_TESTS })
public void testListRoles() {
onPresto().executeQuery(format("CREATE ROLE %s", ROLE1));
QueryResult expected = onHive().executeQuery("SHOW ROLES");
QueryResult actual = onPresto().executeQuery("SELECT * FROM hive.information_schema.roles");
assertThat(actual.rows()).containsOnly(expected.rows().toArray(new List[] {}));
}
use of io.prestodb.tempto.query.QueryResult in project presto by prestodb.
the class TestSyncPartitionMetadata method assertPartitions.
private static void assertPartitions(String tableName, QueryAssert.Row... rows) {
QueryResult partitionListResult = query("SELECT * FROM \"" + tableName + "$partitions\" ORDER BY 1, 2");
assertThat(partitionListResult).containsExactly(rows);
}
use of io.prestodb.tempto.query.QueryResult in project presto by prestodb.
the class JdbcTests method shouldExecuteQueryWithSelectedCatalogAndSchema.
@Test(groups = JDBC)
@Requires(ImmutableNationTable.class)
public void shouldExecuteQueryWithSelectedCatalogAndSchema() throws SQLException {
if (usingTeradataJdbc4Driver(connection())) {
LOGGER.warn("connection().setSchema() is not supported in JDBC 4");
} else {
connection().setCatalog("hive");
connection().setSchema("default");
try (Statement statement = connection().createStatement()) {
QueryResult result = queryResult(statement, "select * from nation");
assertThat(result).matches(PRESTO_NATION_RESULT);
}
}
}
use of io.prestodb.tempto.query.QueryResult in project presto by prestodb.
the class KafkaAvroSmokeTest method testSelectStructuralDataType.
@Test(groups = { KAFKA })
@Requires(StructuralDataTypeTable.class)
public void testSelectStructuralDataType() throws SQLException {
QueryResult queryResult = query(format("SELECT a[1], a[2], m['key1'] FROM (SELECT c_array as a, c_map as m FROM %s.%s) t", KAFKA_CATALOG, STRUCTURAL_AVRO_TABLE_NAME));
assertThat(queryResult).containsOnly(row(100, 102, "value1"));
}
use of io.prestodb.tempto.query.QueryResult in project presto by prestodb.
the class KafkaAvroSmokeTest method testSelectPrimitiveDataType.
@Test(groups = { KAFKA })
@Requires(AllDataTypesAvroTable.class)
public void testSelectPrimitiveDataType() throws SQLException {
QueryResult queryResult = query(format("select * from %s.%s", KAFKA_CATALOG, ALL_DATATYPES_AVRO_TABLE_NAME));
assertThat(queryResult).containsOnly(row("foobar", 127, 234.567, true));
}
Aggregations