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

org.apache.cassandra.cql3.statements

## Class CreateTableStatement

- java.lang.Object
- - org.apache.cassandra.cql3.statements.ParsedStatement
  - - org.apache.cassandra.cql3.statements.CFStatement
    - - org.apache.cassandra.cql3.statements.SchemaAlteringStatement
      - - org.apache.cassandra.cql3.statements.CreateTableStatement

- All Implemented Interfaces:
    CQLStatement

      public class CreateTableStatement
      extends SchemaAlteringStatement

  A `CREATE TABLE` parsed from a CQL query statement.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CreateTableStatement.RawStatement`

    - ### Nested classes/interfaces inherited from class org.apache.cassandra.cql3.statements.ParsedStatement

      `ParsedStatement.Prepared`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `CellNameType` | `comparator`

    - ### Fields inherited from class org.apache.cassandra.cql3.statements.CFStatement

      `cfName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CreateTableStatement(CFName name, CFPropDefs properties, boolean ifNotExists, java.util.Set<ColumnIdentifier> staticColumns)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `announceMigration(boolean isLocalOnly)` Announces the migration to other nodes in the cluster.
    `void` | `applyPropertiesTo(CFMetaData cfmd)`
    `Event.SchemaChange` | `changeEvent()`
    `void` | `checkAccess(ClientState state)` Perform any access verification necessary for the statement.
    `CFMetaData` | `getCFMetaData()` Returns a CFMetaData instance based on the parameters parsed from this `CREATE` statement, or defaults where applicable.
    `void` | `validate(ClientState state)` Perform additional validation required by the statment.

    - ### Methods inherited from class org.apache.cassandra.cql3.statements.SchemaAlteringStatement

      `execute, executeInternal, getBoundTerms, prepare, prepareKeyspace`

    - ### Methods inherited from class org.apache.cassandra.cql3.statements.CFStatement

      `columnFamily, keyspace, prepareKeyspace`

    - ### Methods inherited from class org.apache.cassandra.cql3.statements.ParsedStatement

      `getBoundVariables, setBoundVariables`

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

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

- - ### Field Detail

    - #### comparator

          public CellNameType comparator

  - ### Constructor Detail

    - #### CreateTableStatement

          public CreateTableStatement(CFName name,
                              CFPropDefs properties,
                              boolean ifNotExists,
                              java.util.Set<ColumnIdentifier> staticColumns)

  - ### Method Detail

    - #### checkAccess

          public void checkAccess(ClientState state)
                           throws UnauthorizedException,
                                  InvalidRequestException

      Description copied from interface: `CQLStatement`
      Perform any access verification necessary for the statement.
      Parameters:
        `state` - the current client state
      Throws:
        `UnauthorizedException`
        `InvalidRequestException`

    - #### validate

          public void validate(ClientState state)

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

    - #### announceMigration

          public boolean announceMigration(boolean isLocalOnly)
                                    throws RequestValidationException

      Description copied from class: `SchemaAlteringStatement`
      Announces the migration to other nodes in the cluster.
      Specified by:
        `announceMigration` in class `SchemaAlteringStatement`
      Returns:
        true if the execution of this statement resulted in a schema change, false otherwise (when IF NOT EXISTS is used, for example)
      Throws:
        `RequestValidationException`

    - #### changeEvent

          public Event.SchemaChange changeEvent()

      Specified by:
        `changeEvent` in class `SchemaAlteringStatement`

    - #### getCFMetaData

          public CFMetaData getCFMetaData()
                                   throws RequestValidationException

      Returns a CFMetaData instance based on the parameters parsed from this `CREATE` statement, or defaults where applicable.
      Returns:
        a CFMetaData instance corresponding to the values parsed from this statement
      Throws:
        `InvalidRequestException` - on failure to validate parsed parameters
        `RequestValidationException`

    - #### applyPropertiesTo

          public void applyPropertiesTo(CFMetaData cfmd)
                                 throws RequestValidationException

      Throws:
        `RequestValidationException`

Copyright © 2014 The Apache Software Foundation