use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestSelectMultiColumnKey method testSelectWithFilterOnSecondClusteringKey.
@Test(groups = { CASSANDRA, PROFILE_SPECIFIC_TESTS })
public void testSelectWithFilterOnSecondClusteringKey() {
// Since update_at is the second clustering key, this forces a full table scan.
String sql = format("SELECT value FROM %s.%s.%s WHERE user_id = 'Bob' and updated_at = TIMESTAMP '2014-02-02 03:04:05Z'", CONNECTOR_NAME, KEY_SPACE, CASSANDRA_MULTI_COLUMN_KEY.getName());
QueryResult queryResult = onTrino().executeQuery(sql);
assertThat(queryResult).containsOnly(row("Test value 2"));
}
use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestSelectMultiColumnKey method testSelectWithFilterOnPrimaryKeyNoMatch.
@Test(groups = { CASSANDRA, PROFILE_SPECIFIC_TESTS })
public void testSelectWithFilterOnPrimaryKeyNoMatch() {
String sql = format("SELECT value FROM %s.%s.%s WHERE user_id = 'George'", CONNECTOR_NAME, KEY_SPACE, CASSANDRA_MULTI_COLUMN_KEY.getName());
QueryResult queryResult = onTrino().executeQuery(sql);
assertThat(queryResult).hasNoRows();
}
use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestJdbc method assertConnectionTimezone.
private void assertConnectionTimezone(Connection connection, String timeZoneId) throws SQLException {
try (Statement statement = connection.createStatement()) {
QueryResult result = queryResult(statement, "select current_timezone()");
assertThat(result).contains(row(timeZoneId));
}
}
use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestJdbc method shouldGetColumns.
@Test(groups = JDBC)
@Requires(ImmutableNationTable.class)
public void shouldGetColumns() throws SQLException {
QueryResult result = QueryResult.forResultSet(metaData().getColumns("hive", "default", "nation", null));
assertThat(result).matches(sqlResultDescriptorForResource("io/trino/tests/product/jdbc/get_nation_columns.result"));
}
use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestJdbc method shouldSetLocale.
@Test(groups = JDBC)
public void shouldSetLocale() throws SQLException {
// TODO uew new connection rather than modifying a shared one
((TrinoConnection) connection()).setLocale(CHINESE);
try (Statement statement = connection().createStatement()) {
QueryResult result = queryResult(statement, "SELECT date_format(TIMESTAMP '2001-01-09 09:04', '%M')");
assertThat(result).contains(row("一月"));
}
}
Aggregations