Search in sources :

Example 1 with CassandraColumnHandle

use of com.facebook.presto.cassandra.CassandraColumnHandle in project presto by prestodb.

the class TestCassandraClusteringPredicatesExtractor method setUp.

@BeforeTest
void setUp() throws Exception {
    col1 = new CassandraColumnHandle("cassandra", "partitionKey1", 1, CassandraType.BIGINT, null, true, false, false, false);
    col2 = new CassandraColumnHandle("cassandra", "clusteringKey1", 2, CassandraType.BIGINT, null, false, true, false, false);
    col3 = new CassandraColumnHandle("cassandra", "clusteringKey2", 3, CassandraType.BIGINT, null, false, true, false, false);
    col4 = new CassandraColumnHandle("cassandra", "clusteringKe3", 4, CassandraType.BIGINT, null, false, true, false, false);
    cassandraTable = new CassandraTable(new CassandraTableHandle("cassandra", "test", "records"), ImmutableList.of(col1, col2, col3, col4));
}
Also used : CassandraColumnHandle(com.facebook.presto.cassandra.CassandraColumnHandle) CassandraTable(com.facebook.presto.cassandra.CassandraTable) CassandraTableHandle(com.facebook.presto.cassandra.CassandraTableHandle) BeforeTest(org.testng.annotations.BeforeTest)

Example 2 with CassandraColumnHandle

use of com.facebook.presto.cassandra.CassandraColumnHandle in project presto by prestodb.

the class TestCassandraCqlUtils method testAppendSelectColumns.

@Test
public void testAppendSelectColumns() {
    List<CassandraColumnHandle> columns = ImmutableList.of(new CassandraColumnHandle("", "foo", 0, CassandraType.VARCHAR, null, false, false, false, false), new CassandraColumnHandle("", "bar", 0, CassandraType.VARCHAR, null, false, false, false, false), new CassandraColumnHandle("", "table", 0, CassandraType.VARCHAR, null, false, false, false, false));
    StringBuilder sb = new StringBuilder();
    CassandraCqlUtils.appendSelectColumns(sb, columns);
    String str = sb.toString();
    assertEquals("foo,bar,\"table\"", str);
}
Also used : CassandraColumnHandle(com.facebook.presto.cassandra.CassandraColumnHandle) Test(org.testng.annotations.Test)

Aggregations

CassandraColumnHandle (com.facebook.presto.cassandra.CassandraColumnHandle)2 CassandraTable (com.facebook.presto.cassandra.CassandraTable)1 CassandraTableHandle (com.facebook.presto.cassandra.CassandraTableHandle)1 BeforeTest (org.testng.annotations.BeforeTest)1 Test (org.testng.annotations.Test)1