org.apache.cassandra.cql3.statements

## Class SelectStatement

- java.lang.Object
- - org.apache.cassandra.cql3.statements.SelectStatement

All Implemented Interfaces:
  CQLStatement, MeasurableForPreparedCache

    public class SelectStatement
    extends java.lang.Object
    implements CQLStatement, MeasurableForPreparedCache

Encapsulates a completely parsed SELECT query, including the target column family, expression, result count, and ordering clause.

### Nested Class Summary

Nested Classes
`static class` `SelectStatement.Parameters`
`static class` `SelectStatement.RawStatement`

### Field Summary

Fields
`CFDefinition` `cfDef`
`SelectStatement.Parameters` `parameters`

### Constructor Summary

Constructors
Constructor and Description
`SelectStatement(CFDefinition cfDef, int boundTerms, SelectStatement.Parameters parameters, Selection selection, Term limit)`

### Method Summary

Methods
`void` `checkAccess(ClientState state)` Perform any access verification necessary for the statement.
`java.lang.String` `columnFamily()`
`ResultMessage.Rows` `execute(QueryState state, QueryOptions options)` Execute the statement and return the resulting result or null if there is no result.
`ResultMessage.Rows` `executeInternal(QueryState state)` Variante of execute used for internal query against the system tables, and thus only query the local node.
`int` `getBoundTerms()` Returns the number of bound terms in this statement.
`java.util.List<IndexExpression>` `getIndexExpressions(java.util.List<java.nio.ByteBuffer> variables)`
`ResultSet.Metadata` `getResultMetadata()`
`java.lang.String` `keyspace()`
`long` `measureForPreparedCache(org.github.jamm.MemoryMeter meter)`
`ResultSet` `process(java.util.List<Row> rows)`
`ResultMessage.Rows` `processResults(java.util.List<Row> rows, java.util.List<java.nio.ByteBuffer> variables, int limit, long now)`
`void` `validate(ClientState state)` Perform additional validation required by the statment.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### cfDef

    public final CFDefinition cfDef

#### parameters

    public final SelectStatement.Parameters parameters

### Constructor Detail

#### SelectStatement

    public SelectStatement(CFDefinition cfDef,
                   int boundTerms,
                   SelectStatement.Parameters parameters,
                   Selection selection,
                   Term limit)

### Method Detail

#### getResultMetadata

    public ResultSet.Metadata getResultMetadata()

#### measureForPreparedCache

    public long measureForPreparedCache(org.github.jamm.MemoryMeter meter)

Specified by:
  `measureForPreparedCache` in interface `MeasurableForPreparedCache`

#### getBoundTerms

    public int getBoundTerms()

Description copied from interface: `CQLStatement`
Returns the number of bound terms in this statement.

Specified by:
  `getBoundTerms` in interface `CQLStatement`

#### checkAccess

    public void checkAccess(ClientState state)
                     throws InvalidRequestException,
                            UnauthorizedException

Description copied from interface: `CQLStatement`
Perform any access verification necessary for the statement.

Specified by:
  `checkAccess` in interface `CQLStatement`
Parameters:
  `state` - the current client state
Throws:
  `InvalidRequestException`
  `UnauthorizedException`

#### validate

    public void validate(ClientState state)
                  throws InvalidRequestException

Description copied from interface: `CQLStatement`
Perform additional validation required by the statment. To be overriden by subclasses if needed.

Specified by:
  `validate` in interface `CQLStatement`
Parameters:
  `state` - the current client state
Throws:
  `InvalidRequestException`

#### execute

    public ResultMessage.Rows execute(QueryState state,
                             QueryOptions options)
                               throws RequestExecutionException,
                                      RequestValidationException

Description copied from interface: `CQLStatement`
Execute the statement and return the resulting result or null if there is no result.

Specified by:
  `execute` in interface `CQLStatement`
Parameters:
  `state` - the current query state
  `options` - options for this query (consistency, variables, pageSize, ...)
Throws:
  `RequestExecutionException`
  `RequestValidationException`

#### processResults

    public ResultMessage.Rows processResults(java.util.List<Row> rows,
                                    java.util.List<java.nio.ByteBuffer> variables,
                                    int limit,
                                    long now)
                                      throws RequestValidationException

Throws:
  `RequestValidationException`

#### executeInternal

    public ResultMessage.Rows executeInternal(QueryState state)
                                       throws RequestExecutionException,
                                              RequestValidationException

Description copied from interface: `CQLStatement`
Variante of execute used for internal query against the system tables, and thus only query the local node.

Specified by:
  `executeInternal` in interface `CQLStatement`
Parameters:
  `state` - the current query state
Throws:
  `RequestExecutionException`
  `RequestValidationException`

#### process

    public ResultSet process(java.util.List<Row> rows)
                      throws InvalidRequestException

Throws:
  `InvalidRequestException`

#### keyspace

    public java.lang.String keyspace()

#### columnFamily

    public java.lang.String columnFamily()

#### getIndexExpressions

    public java.util.List<IndexExpression> getIndexExpressions(java.util.List<java.nio.ByteBuffer> variables)
                                                        throws InvalidRequestException

Throws:
  `InvalidRequestException`