SelectStatement (apache-cassandra API)
Date: 2014-10-21

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
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SelectStatement.Parameters`
    `static class` | `SelectStatement.RawStatement`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `CFMetaData` | `cfm`
    `SelectStatement.Parameters` | `parameters`

  - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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, QueryOptions options)` 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.
    `Pageable` | `getPageableCommand(QueryOptions options)`
    `ResultSet.Metadata` | `getResultMetadata()`
    `java.util.List<IndexExpression>` | `getValidatedIndexExpressions(QueryOptions options)`
    `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, QueryOptions options, 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

    - #### cfm

          public final CFMetaData cfm

    - #### parameters

          public final SelectStatement.Parameters parameters

  - ### Constructor Detail

    - #### SelectStatement

          public SelectStatement(CFMetaData cfm,
                         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`

    - #### getPageableCommand

          public Pageable getPageableCommand(QueryOptions options)
                                      throws RequestValidationException

      Throws:
        `RequestValidationException`

    - #### processResults

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

      Throws:
        `RequestValidationException`

    - #### executeInternal

          public ResultMessage.Rows executeInternal(QueryState state,
                                           QueryOptions options)
                                             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()

    - #### getValidatedIndexExpressions

          public java.util.List<IndexExpression> getValidatedIndexExpressions(QueryOptions options)
                                                                       throws InvalidRequestException

      Throws:
        `InvalidRequestException`

Copyright © 2014 The Apache Software Foundation