Add Field

Hippo supports adding fields into a table dynamically.

curl -u shiva:shiva -XPOST 'localhost:8902/hippo/v1/book/_add_columns?database_name={database_name}&pretty' -H 'Content-Type: application/json' -d'{
  "fields": [
    {
      "name": "book_name",
      "data_type": "string"
    },
    {
      "name": "author",
      "data_type": "string"
    }
  ]
}';

Result:

{
  "acknowledged" : true
}

Parameter description:

ParametersDescriptionRequired
table_nameTable to add fieldsYes
database_nameDatabase where the table is locatedNo, defaults to "default" database
fieldsSet of fields to be addedYes
name (fields)Field namesYes
data_type (fields)Field data typesYes, the options can be referred at Create Table
dim (type_params)Vector dimensions[1, 65536]
length (type_params)Varchar/Varchar 2, length[1, 65536]
Table 3 Add Column (Restful API)