CreateFunctionStatement (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.cql3.statements

## Class CreateFunctionStatement

- 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.CreateFunctionStatement

- All Implemented Interfaces:
    CQLStatement

      public final class CreateFunctionStatement
      extends SchemaAlteringStatement

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

- - ### Nested Class Summary

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

      `ParsedStatement.Prepared`

  - ### Field Summary

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

      `cfName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CreateFunctionStatement(FunctionName functionName, java.lang.String language, java.lang.String body, java.util.List<ColumnIdentifier> argNames, java.util.List<CQL3Type.Raw> argRawTypes, CQL3Type.Raw rawReturnType, boolean calledOnNullInput, boolean orReplace, boolean ifNotExists)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `announceMigration(boolean isLocalOnly)` Announces the migration to other nodes in the cluster.
    `Event.SchemaChange` | `changeEvent()`
    `void` | `checkAccess(ClientState state)` Perform any access verification necessary for the statement.
    `protected void` | `grantPermissionsToCreator(QueryState state)` Schema alteration may result in a new database object (keyspace, table, role, function) being created capable of having permissions GRANTed on it.
    `ParsedStatement.Prepared` | `prepare()`
    `void` | `prepareKeyspace(ClientState state)`
    `void` | `validate(ClientState state)` Perform additional validation required by the statment.

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

      `execute, executeInternal, getBoundTerms`

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

      `columnFamily, keyspace, prepareKeyspace`

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

      `getBoundVariables, getFunctions, setBoundVariables`

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

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

    - ### Methods inherited from interface org.apache.cassandra.cql3.CQLStatement

      `getFunctions`

- - ### Constructor Detail

    - #### CreateFunctionStatement

          public CreateFunctionStatement(FunctionName functionName,
                                         java.lang.String language,
                                         java.lang.String body,
                                         java.util.List<ColumnIdentifier> argNames,
                                         java.util.List<CQL3Type.Raw> argRawTypes,
                                         CQL3Type.Raw rawReturnType,
                                         boolean calledOnNullInput,
                                         boolean orReplace,
                                         boolean ifNotExists)

  - ### Method Detail

    - #### prepare

          public ParsedStatement.Prepared prepare()
                                           throws InvalidRequestException

      Overrides:
        `prepare` in class `SchemaAlteringStatement`
      Throws:
        `InvalidRequestException`

    - #### prepareKeyspace

          public void prepareKeyspace(ClientState state)
                               throws InvalidRequestException

      Overrides:
        `prepareKeyspace` in class `SchemaAlteringStatement`
      Throws:
        `InvalidRequestException`

    - #### grantPermissionsToCreator

          protected void grantPermissionsToCreator(QueryState state)

      Description copied from class: `SchemaAlteringStatement`
      Schema alteration may result in a new database object (keyspace, table, role, function) being created capable of having permissions GRANTed on it. The creator of the object (the primary role assigned to the AuthenticatedUser performing the operation) is automatically granted ALL applicable permissions on the object. This is a hook for subclasses to override in order to perform that grant when the statement is executed.
      Overrides:
        `grantPermissionsToCreator` in class `SchemaAlteringStatement`

    - #### 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)
                        throws InvalidRequestException

      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
      Throws:
        `InvalidRequestException`

    - #### changeEvent

          public Event.SchemaChange changeEvent()

      Specified by:
        `changeEvent` in class `SchemaAlteringStatement`

    - #### 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`

Copyright © 2018 The Apache Software Foundation