use of io.prestodb.tempto.query.QueryResult in project urban-eureka by errir503.
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 urban-eureka by errir503.
the class KafkaSmokeTest method testSelectSimpleKeyAndValue.
@Test(groups = { KAFKA })
@Requires(SimpleKeyAndValueTable.class)
public void testSelectSimpleKeyAndValue() {
QueryResult queryResult = query(format("select varchar_key, bigint_key, varchar_value, bigint_value from %s.%s.%s", KAFKA_CATALOG, SCHEMA_NAME, SIMPLE_KEY_AND_VALUE_TABLE_NAME));
assertThat(queryResult).containsOnly(row("jasio", 1, "ania", 2), row("piotr", 3, "kasia", 4));
}
use of io.prestodb.tempto.query.QueryResult in project urban-eureka by errir503.
the class TestInsert method testInsertMin.
@Test(groups = { SQL_SERVER, PROFILE_SPECIFIC_TESTS })
public void testInsertMin() {
String sql = format("INSERT INTO %s.%s values (BIGINT '%s', SMALLINT '%s', INTEGER '%s', DOUBLE '%s', " + "CHAR 'a ', 'aa', DOUBLE '%s', DATE '%s')", SQLSERVER, INSERT_TABLE_NAME, Long.valueOf("-9223372036854775807"), Short.MIN_VALUE, Integer.MIN_VALUE, Double.MIN_VALUE, Double.MIN_VALUE, Date.valueOf("1970-01-01"));
// Min value for BIGINT would be updated to "-9223372036854775808" post https://github.com/prestodb/presto/issues/4571
onPresto().executeQuery(sql);
sql = format("SELECT * FROM %s.%s", MASTER, INSERT_TABLE_NAME);
QueryResult queryResult = onSqlServer().executeQuery(sql);
assertThat(queryResult).contains(row(Long.valueOf("-9223372036854775807"), Short.MIN_VALUE, Integer.MIN_VALUE, Double.MIN_VALUE, "a ", "aa", Double.MIN_VALUE, Date.valueOf("1970-01-01")));
}
use of io.prestodb.tempto.query.QueryResult in project urban-eureka by errir503.
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);
onPresto().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.prestodb.tempto.query.QueryResult in project urban-eureka by errir503.
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"));
onPresto().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")));
}
Aggregations