use of io.prestodb.tempto.query.QueryResult in project urban-eureka by errir503.
the class TestAllDatatypesFromHiveConnector method testSelectAllDatatypesOrc.
@Requires(OrcRequirements.class)
@Test(groups = { JDBC })
public void testSelectAllDatatypesOrc() {
String tableName = mutableTableInstanceOf(ALL_HIVE_SIMPLE_TYPES_ORC).getNameInDatabase();
populateDataToHiveTable(tableName);
assertProperAllDatatypesSchema(tableName);
QueryResult queryResult = query(format("SELECT * FROM %s", tableName));
assertColumnTypes(queryResult);
assertThat(queryResult).containsOnly(row(127, 32767, 2147483647, 9223372036854775807L, 123.345f, 234.567, new BigDecimal("346"), new BigDecimal("345.67800"), Timestamp.valueOf(LocalDateTime.of(2015, 5, 10, 12, 15, 35, 123_000_000)), Date.valueOf("2015-05-10"), "ala ma kota", "ala ma kot", "ala ma ", true, "kot binarny".getBytes()));
}
use of io.prestodb.tempto.query.QueryResult in project urban-eureka by errir503.
the class TestSelect method testCreateTableAsSelect.
@Test(groups = { SQL_SERVER, PROFILE_SPECIFIC_TESTS })
public void testCreateTableAsSelect() {
String sql = format("CREATE TABLE %s AS SELECT * FROM %s", CREATE_TABLE_AS_SELECT, NATION_TABLE_NAME);
onPresto().executeQuery(sql);
sql = format("SELECT n_nationkey, n_name, n_regionkey, n_comment FROM %s.%s.%s", "master", KEY_SPACE, CTAS_TABLE_NAME);
QueryResult queryResult = onSqlServer().executeQuery(sql);
assertThat(queryResult).matches(PRESTO_NATION_RESULT);
}
use of io.prestodb.tempto.query.QueryResult in project urban-eureka by errir503.
the class TestSelectMultiColumnKey method testSelectWithEqualityFilterOnPrimaryAndClusteringKeys.
@Test(groups = CASSANDRA)
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:01'", CONNECTOR_NAME, KEY_SPACE, CASSANDRA_MULTI_COLUMN_KEY.getName());
QueryResult queryResult = onPresto().executeQuery(sql);
assertThat(queryResult).containsOnly(row("Test value 1"));
}
use of io.prestodb.tempto.query.QueryResult in project urban-eureka by errir503.
the class TestSelectMultiColumnKey method testSelectWithFilterOnPrefixOfClusteringKey.
@Test(groups = CASSANDRA)
public void testSelectWithFilterOnPrefixOfClusteringKey() {
String sql = format("SELECT value FROM %s.%s.%s WHERE user_id = 'Bob' and key = 'b1'", CONNECTOR_NAME, KEY_SPACE, CASSANDRA_MULTI_COLUMN_KEY.getName());
QueryResult queryResult = onPresto().executeQuery(sql);
assertThat(queryResult).containsOnly(row("Test value 2"));
}
use of io.prestodb.tempto.query.QueryResult in project urban-eureka by errir503.
the class TestSelectMultiColumnKey method testSelectWithEqualityFilterOnClusteringKey.
@Test(groups = CASSANDRA)
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 = onPresto().executeQuery(sql);
assertThat(queryResult).containsOnly(row("Test value 1"));
}
Aggregations