use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestSelect method testProtocolVersion.
@Test(groups = { CASSANDRA, PROFILE_SPECIFIC_TESTS })
public void testProtocolVersion() {
QueryResult queryResult = onTrino().executeQuery(format("SELECT native_protocol_version FROM %s.system.local", CONNECTOR_NAME));
assertThat(queryResult).containsOnly(row("4"));
}
use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestSelect method testNationJoinNation.
@Test(groups = { CASSANDRA, PROFILE_SPECIFIC_TESTS })
public void testNationJoinNation() {
String tableName = format("%s.%s.%s", CONNECTOR_NAME, KEY_SPACE, CASSANDRA_NATION.getName());
String sql = format("SELECT n1.n_name, n2.n_regionkey FROM %s n1 JOIN " + "%s n2 ON n1.n_nationkey = n2.n_regionkey " + "WHERE n1.n_nationkey=3", tableName, tableName);
QueryResult queryResult = onTrino().executeQuery(sql);
assertThat(queryResult).containsOnly(row("CANADA", 3), row("CANADA", 3), row("CANADA", 3), row("CANADA", 3), row("CANADA", 3));
}
use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestSelectMultiColumnKey method testSelectWithEqualityFilterOnPrimaryAndClusteringKeys.
@Test(groups = { CASSANDRA, PROFILE_SPECIFIC_TESTS })
public void testSelectWithEqualityFilterOnPrimaryAndClusteringKeys() {
String sql = format("SELECT value FROM %s.%s.%s WHERE user_id = 'Alice' and key = 'a1' and updated_at = TIMESTAMP '2015-01-01 01:01:01Z'", CONNECTOR_NAME, KEY_SPACE, CASSANDRA_MULTI_COLUMN_KEY.getName());
QueryResult queryResult = onTrino().executeQuery(sql);
assertThat(queryResult).containsOnly(row("Test value 1"));
}
use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestSelectMultiColumnKey method testSelectWithEqualityFilterOnClusteringKey.
@Test(groups = { CASSANDRA, PROFILE_SPECIFIC_TESTS })
public void testSelectWithEqualityFilterOnClusteringKey() {
String sql = format("SELECT value FROM %s.%s.%s WHERE key = 'a1'", CONNECTOR_NAME, KEY_SPACE, CASSANDRA_MULTI_COLUMN_KEY.getName());
QueryResult queryResult = onTrino().executeQuery(sql);
assertThat(queryResult).containsOnly(row("Test value 1"));
}
use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestClickHouse method testCreateTableAsSelect.
@Test(groups = { CLICKHOUSE, PROFILE_SPECIFIC_TESTS })
public void testCreateTableAsSelect() {
QueryResult result = onTrino().executeQuery("CREATE TABLE nation AS SELECT * FROM tpch.tiny.nation");
try {
assertThat(result).updatedRowsCountIsEqualTo(25);
assertThat(onTrino().executeQuery("SELECT COUNT(*) FROM nation")).containsOnly(row(25));
} finally {
onTrino().executeQuery("DROP TABLE nation");
}
}
Aggregations