mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 01:58:34 +08:00
fix: Refine the err msg of alter index invalid (#39137)
fix: Refine the err msg of alter index invalid issue: https://github.com/milvus-io/milvus/issues/38517 Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
This commit is contained in:
parent
7d32603d4d
commit
e5eb1159e2
@ -619,13 +619,13 @@ func (t *alterIndexTask) PreExecute(ctx context.Context) error {
|
|||||||
if len(t.req.GetExtraParams()) > 0 {
|
if len(t.req.GetExtraParams()) > 0 {
|
||||||
for _, param := range t.req.GetExtraParams() {
|
for _, param := range t.req.GetExtraParams() {
|
||||||
if !indexparams.IsConfigableIndexParam(param.GetKey()) {
|
if !indexparams.IsConfigableIndexParam(param.GetKey()) {
|
||||||
return merr.WrapErrParameterInvalidMsg("%s is not a configable index proptery", param.GetKey())
|
return merr.WrapErrParameterInvalidMsg("%s is not a configable index property", param.GetKey())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if len(t.req.GetDeleteKeys()) > 0 {
|
} else if len(t.req.GetDeleteKeys()) > 0 {
|
||||||
for _, param := range t.req.GetDeleteKeys() {
|
for _, param := range t.req.GetDeleteKeys() {
|
||||||
if !indexparams.IsConfigableIndexParam(param) {
|
if !indexparams.IsConfigableIndexParam(param) {
|
||||||
return merr.WrapErrParameterInvalidMsg("%s is not a configable index proptery", param)
|
return merr.WrapErrParameterInvalidMsg("%s is not a configable index property", param)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class IndexErrorMessage(ExceptionsMessage):
|
|||||||
CheckBitmapIndex = "bitmap index are only supported on bool, int, string"
|
CheckBitmapIndex = "bitmap index are only supported on bool, int, string"
|
||||||
CheckBitmapOnPK = "create bitmap index on primary key not supported"
|
CheckBitmapOnPK = "create bitmap index on primary key not supported"
|
||||||
CheckBitmapCardinality = "failed to check bitmap cardinality limit, should be larger than 0 and smaller than 1000"
|
CheckBitmapCardinality = "failed to check bitmap cardinality limit, should be larger than 0 and smaller than 1000"
|
||||||
NotConfigable = "{0} is not a configable index proptery"
|
NotConfigable = "{0} is not a configable index property"
|
||||||
InvalidOffsetCache = "invalid offset cache index params"
|
InvalidOffsetCache = "invalid offset cache index params"
|
||||||
OneIndexPerField = "at most one distinct index is allowed per field"
|
OneIndexPerField = "at most one distinct index is allowed per field"
|
||||||
AlterOnLoadedCollection = "can't alter index on loaded collection, please release the collection first"
|
AlterOnLoadedCollection = "can't alter index on loaded collection, please release the collection first"
|
||||||
|
|||||||
@ -85,7 +85,7 @@ class TestMilvusClientAlterIndex(TestMilvusClientV2Base):
|
|||||||
for p in properties.items():
|
for p in properties.items():
|
||||||
if p[0] not in ["mmap.enabled"]:
|
if p[0] not in ["mmap.enabled"]:
|
||||||
log.debug(f"try to alter index property: {p[0]}")
|
log.debug(f"try to alter index property: {p[0]}")
|
||||||
error = {ct.err_code: 1, ct.err_msg: f"{p[0]} is not a configable index proptery"}
|
error = {ct.err_code: 1, ct.err_msg: f"{p[0]} is not a configable index property"}
|
||||||
new_value = p[1] + 1 if isinstance(p[1], numbers.Number) else "new_value"
|
new_value = p[1] + 1 if isinstance(p[1], numbers.Number) else "new_value"
|
||||||
self.alter_index_properties(client, collection_name, vector_field_name,
|
self.alter_index_properties(client, collection_name, vector_field_name,
|
||||||
properties={p[0]: new_value},
|
properties={p[0]: new_value},
|
||||||
|
|||||||
@ -1428,7 +1428,7 @@ class TestIndexInvalid(TestcaseBase):
|
|||||||
collection_w.alter_index(ct.default_index_name, {"error_param_key": 123},
|
collection_w.alter_index(ct.default_index_name, {"error_param_key": 123},
|
||||||
check_task=CheckTasks.err_res,
|
check_task=CheckTasks.err_res,
|
||||||
check_items={ct.err_code: 1100,
|
check_items={ct.err_code: 1100,
|
||||||
ct.err_msg: "error_param_key is not a configable index proptery:"})
|
ct.err_msg: "error_param_key is not a configable index property:"})
|
||||||
collection_w.alter_index(ct.default_index_name, ["error_param_type"],
|
collection_w.alter_index(ct.default_index_name, ["error_param_type"],
|
||||||
check_task=CheckTasks.err_res,
|
check_task=CheckTasks.err_res,
|
||||||
check_items={ct.err_code: 1,
|
check_items={ct.err_code: 1,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user