Hippo supports table alias. Here is a typical application scenario. When users need to change the embedding algorithm for a table, they need to update all the vector columns, which is time-consuming. To avoid impact on query, users can set alias for the table. They can use table alias to perform analytics, and when updating embedding algorithm, create a table to store new vector data then refer the alias to this newly created table when everything is done.
Operations with Alias
Renaming a table does not have impact on table alias.
curl -u shiva:shiva -XPOST 'localhost:8902/hippo/v1/_aliases?pretty' -H 'Content-Type: application/json' -d'{
"actions" : [
{
"type" : "Add",
"alias_name" : "book_alias",
"table_name" : "book",
"database_name" : "default"
}
]
}'
Result:
{
"acknowledged" : true
}
Parameter description:
Parameters | Description | Options |
---|---|---|
actions | Specifies operations performed on table alias | |
type | Alias operation type. Adds table into one target alias or removes table from alias | Add/Remove |
alias_name | Alias to be operated | |
table_name | Table to be operated | |
is_write_table | When table alias only refers to one table, all data access requests sent to this alias will be redirected to the corresponding table. Otherwise, write requests will be redirected to a table where “is_write_table” is set to true, and read requests will be sent to the first table alias refers to. For tables assigned with same alias, only one can have this parameter set to true | True/False |
database_name | The database where the table is located |
Check Alias
curl -u shiva:shiva -XGET 'localhost:8902/hippo/v1/_cat/aliases?v'
Result:
alias index
bool_alias default#book
Delete Alias
When deleting all the tables that alias refer to, this alias will be deleted automatically. Besides, users can run below command to delete alias directly.
curl -u shiva:shiva -XDELETE 'localhost:8902/hippo/v1/_aliases/{alias}?pretty'
Result:
{
"acknowledged" : true
}
Parameter description:
Parameters | Description | Required |
---|---|---|
alias | Alias to be deleted | Yes |