use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestInsert method testInsertNull.
@Test(groups = { SQL_SERVER, PROFILE_SPECIFIC_TESTS })
public void testInsertNull() {
String sql = format("INSERT INTO %s.%s values (null, null, null, null, null, null, null, null)", SQLSERVER, INSERT_TABLE_NAME);
onTrino().executeQuery(sql);
sql = format("SELECT * FROM %s.%s", MASTER, INSERT_TABLE_NAME);
QueryResult queryResult = onSqlServer().executeQuery(sql);
assertThat(queryResult).contains(row(null, null, null, null, null, null, null, null));
}
use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestInsert method testInsertMax.
@Test(groups = { SQL_SERVER, PROFILE_SPECIFIC_TESTS })
public void testInsertMax() {
String sql = format("INSERT INTO %s.%s values (BIGINT '%s', SMALLINT '%s', INTEGER '%s', DOUBLE '%s', " + "CHAR 'aaaa', 'aaaaaa', DOUBLE '%s', DATE '%s' )", SQLSERVER, INSERT_TABLE_NAME, Long.MAX_VALUE, Short.MAX_VALUE, Integer.MAX_VALUE, Double.MAX_VALUE, Double.valueOf("12345678912.3456756"), Date.valueOf("9999-12-31"));
onTrino().executeQuery(sql);
sql = format("SELECT * FROM %s.%s", MASTER, INSERT_TABLE_NAME);
QueryResult queryResult = onSqlServer().executeQuery(sql);
assertThat(queryResult).contains(row(Long.MAX_VALUE, Short.MAX_VALUE, Integer.MAX_VALUE, Double.MAX_VALUE, "aaaa", "aaaaaa", Double.valueOf("12345678912.3456756"), Date.valueOf("9999-12-31")));
}
use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestSelect method testSelectNation.
@Test(groups = { SQL_SERVER, PROFILE_SPECIFIC_TESTS })
public void testSelectNation() {
QueryResult queryResult = onTrino().executeQuery("SELECT n_nationkey, n_name, n_regionkey, n_comment FROM " + NATION_TABLE_NAME);
assertThat(queryResult).matches(PRESTO_NATION_RESULT);
}
use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestSelect method testCreateTableAsSelect.
@Test(groups = { SQL_SERVER, PROFILE_SPECIFIC_TESTS })
public void testCreateTableAsSelect() {
onTrino().executeQuery(format("CREATE TABLE %s AS SELECT * FROM %s", CREATE_TABLE_AS_SELECT, NATION_TABLE_NAME));
QueryResult queryResult = onSqlServer().executeQuery(format("SELECT n_nationkey, n_name, n_regionkey, n_comment FROM %s.%s.%s", "master", KEY_SPACE, CTAS_TABLE_NAME));
assertThat(queryResult).matches(PRESTO_NATION_RESULT);
}
use of io.trino.tempto.query.QueryResult in project trino by trinodb.
the class TestSelect method testNationJoinRegion.
@Test(groups = { SQL_SERVER, PROFILE_SPECIFIC_TESTS })
public void testNationJoinRegion() {
String sql = format("SELECT c.n_name, t.name FROM %s c JOIN " + "tpch.tiny.region t ON c.n_regionkey = t.regionkey " + "WHERE c.n_nationkey=3", NATION_TABLE_NAME);
QueryResult queryResult = onTrino().executeQuery(sql);
assertThat(queryResult).containsOnly(row("CANADA", "AMERICA"));
}
Aggregations