Search in sources :

Example 6 with SelectStatement

use of org.apache.cassandra.cql3.statements.SelectStatement in project cassandra by apache.

the class View method getSelectStatement.

/**
     * Returns the SelectStatement used to populate and filter this view.  Internal users should access the select
     * statement this way to ensure it has been prepared.
     */
public SelectStatement getSelectStatement() {
    if (select == null) {
        ClientState state = ClientState.forInternalCalls();
        state.setKeyspace(baseCfs.keyspace.getName());
        rawSelect.prepareKeyspace(state);
        ParsedStatement.Prepared prepared = rawSelect.prepare(true);
        select = (SelectStatement) prepared.statement;
    }
    return select;
}
Also used : ClientState(org.apache.cassandra.service.ClientState) ParsedStatement(org.apache.cassandra.cql3.statements.ParsedStatement)

Aggregations

SelectStatement (org.apache.cassandra.cql3.statements.SelectStatement)4 UntypedResultSet (org.apache.cassandra.cql3.UntypedResultSet)2 ClientState (org.apache.cassandra.service.ClientState)2 ResultMessage (org.apache.cassandra.transport.messages.ResultMessage)2 QueryOptions (org.apache.cassandra.cql3.QueryOptions)1 StatementRestrictions (org.apache.cassandra.cql3.restrictions.StatementRestrictions)1 RawSelector (org.apache.cassandra.cql3.selection.RawSelector)1 Selectable (org.apache.cassandra.cql3.selection.Selectable)1 ParsedStatement (org.apache.cassandra.cql3.statements.ParsedStatement)1 DurationType (org.apache.cassandra.db.marshal.DurationType)1 AlreadyExistsException (org.apache.cassandra.exceptions.AlreadyExistsException)1 AuthenticationException (org.apache.cassandra.exceptions.AuthenticationException)1 InvalidRequestException (org.apache.cassandra.exceptions.InvalidRequestException)1 RequestExecutionException (org.apache.cassandra.exceptions.RequestExecutionException)1 ColumnMetadata (org.apache.cassandra.schema.ColumnMetadata)1 TableMetadata (org.apache.cassandra.schema.TableMetadata)1 TableParams (org.apache.cassandra.schema.TableParams)1 ViewMetadata (org.apache.cassandra.schema.ViewMetadata)1 Test (org.junit.Test)1