Search in sources :

Example 1 with SimpleStm

use of org.apache.zeppelin.cassandra.TextBlockHierarchy.SimpleStm in project zeppelin by apache.

the class InterpreterLogicTest method should_generate_simple_statement.

@Test
public void should_generate_simple_statement() {
    // Given
    String input = "SELECT * FROM users LIMIT 10;";
    CassandraQueryOptions options = new CassandraQueryOptions(Option.apply(QUORUM), Option.empty(), Option.empty(), Option.empty(), Option.empty());
    // When
    final SimpleStatement actual = helper.generateSimpleStatement(new SimpleStm(input), options, intrContext);
    // Then
    assertThat(actual).isNotNull();
    assertThat(actual.getQuery()).isEqualTo("SELECT * FROM users LIMIT 10;");
    assertThat(actual.getConsistencyLevel()).isSameAs(QUORUM);
}
Also used : SimpleStatement(com.datastax.oss.driver.api.core.cql.SimpleStatement) SimpleStm(org.apache.zeppelin.cassandra.TextBlockHierarchy.SimpleStm) Test(org.junit.Test)

Aggregations

SimpleStatement (com.datastax.oss.driver.api.core.cql.SimpleStatement)1 SimpleStm (org.apache.zeppelin.cassandra.TextBlockHierarchy.SimpleStm)1 Test (org.junit.Test)1