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:
Parameters | Description | Required |
---|---|---|
table_name | Table to add fields | Yes |
database_name | Database where the table is located | No, defaults to "default" database |
fields | Set of fields to be added | Yes |
name (fields) | Field names | Yes |
data_type (fields) | Field data types | Yes, the options can be referred at Create Table |
dim (type_params) | Vector dimensions | [1, 65536] |
length (type_params) | Varchar/Varchar 2, length | [1, 65536] |