> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# /alter/table/columns

```
URL: http://<db.host>:<db.port>/alter/table/columns
```

Apply various modifications to columns in a table, view.  The available
modifications include the following:

Create or delete an [index](../../concepts/indexes/#column-index) on a
particular column. This can speed up certain operations when using expressions
containing equality or relational operators on indexed columns. This only
applies to tables.

Manage a table's columns--a column can be added, removed, or have its
[type and properties](../../concepts/types/) modified, including whether
it is [dictionary encoded](../../concepts/dictionary_encoding/) or not.

## Input Parameter Description

<ParamField body="table_name" type="string">
  Table on which the operation will be performed. Must be an existing table or view, in \[schema\_name.]table\_name format, using standard [name resolution rules](../../concepts/tables/#table-name-resolution).
</ParamField>

<ParamField body="column_alterations" type="array of maps of string to strings">
  List of alter table add/delete/change column requests - all for the same table. Each request is a map that includes 'column\_name', 'action' and the options specific for the action. Note that the same options as in alter table requests but in the same map as the column name and the action. For example: \[\{'column\_name':'col\_1','action':'change\_column','rename\_column':'col\_2'},\{'column\_name':'col\_1','action':'add\_column', 'type':'int','default\_value':'1'}].
</ParamField>

<ParamField body="options" type="map of string to strings">
  Optional parameters.
</ParamField>

## Output Parameter Description

The Kinetica server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query.  Here is a description of the various fields of the wrapper:

<ResponseField name="status" type="String">
  'OK' or 'ERROR'
</ResponseField>

<ResponseField name="message" type="String">
  Empty if success or an error message
</ResponseField>

<ResponseField name="data_type" type="String">
  'alter\_table\_columns\_response' or 'none' in case of an error
</ResponseField>

<ResponseField name="data" type="String">
  Empty string
</ResponseField>

<ResponseField name="data_str" type="JSON or String">
  This embedded JSON represents the result of the /alter/table/columns endpoint:

  <Expandable title="data_str">
    <ResponseField name="table_name" type="string">
      Table on which the operation was performed.
    </ResponseField>

    <ResponseField name="type_id" type="string">
      Return the type\_id (when changing a table, a new type may be created).
    </ResponseField>

    <ResponseField name="type_definition" type="string">
      Return the type\_definition  (when changing a table, a new type may be created).
    </ResponseField>

    <ResponseField name="properties" type="map of string to arrays of strings">
      Return the type properties  (when changing a table, a new type may be created).
    </ResponseField>

    <ResponseField name="label" type="string">
      Return the type label  (when changing a table, a new type may be created).
    </ResponseField>

    <ResponseField name="column_alterations" type="array of maps of string to strings">
      List of alter table add/delete/change column requests - all for the same table. Each request is a map that includes 'column\_name', 'action' and the options specific for the action. Note that the same options as in alter table requests but in the same map as the column name and the action. For example: \[\{'column\_name':'col\_1','action':'change\_column','rename\_column':'col\_2'},\{'column\_name':'col\_1','action':'add\_column', 'type':'int','default\_value':'1'}].
    </ResponseField>

    <ResponseField name="info" type="map of string to strings">
      Additional information.
    </ResponseField>
  </Expandable>

  Empty string in case of an error.
</ResponseField>
