Alias

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:

ParametersDescriptionOptions
actionsSpecifies operations performed on table alias
typeAlias operation type. Adds table into one target alias or removes table from aliasAdd/Remove
alias_nameAlias to be operated
table_nameTable to be operated
is_write_tableWhen 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 trueTrue/False
database_nameThe database where the table is located
Table 15 Operations with Alias (Restful API)

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:

ParametersDescriptionRequired
aliasAlias to be deletedYes
Table 16 Delete Alias (Restful API)