alter space
Use alter space command to add a field to an existing space definition, or to add or drop an index from a space definition.
Syntax
alter space <string> add (field name <string> type <string> [nullable <boolean>] [encrypted <boolean>](, field name <string> type <string> [nullable <boolean>])*) alter space <string> add index ( name <string> [type <string>] fields (<string> (, <string>)*)) alter space <string> drop index (<index_name> (, <index_name>)*)
Parameters
The following table describes the parameters for this command.
Examples for add field:
alter space “myspace” add (field name “average” type “double”) alter space “myspace” add (field name “average” type “double” nullable true) alter space “myspace” add (field name “average” type “double”, field name “total” type “long” nullable true)
Examples for add index:
alter space add index (name “index1” type “hash” fields(“a”, “b”, “c”)) alter space add index (name “index1” type “hash” fields(“a”, “b”, “c”)) index (name “index2” type “hash” fields(“a”, “b”, “c”))
Examples for drop index:
alter space drop index (“index1”) alter space drop index (“index1”, “index2”)
Example for adding a field and an index:
alter space “myspace” add (field name “average” type “double”) index (name “index1” type “hash” fields(“a”, “b”, “c”))
The parameters for fields and index use the following format:
- fields: (field name “average” type “double”)
- index: index (name “index1” type “hash” fields(“a”, “b”, “c”))
You can perform consecutive updates by adding one field after another.
Related concepts
Related tasks
Related reference
Copyright © Cloud Software Group, Inc. All rights reserved.