fix: optimize invalid datatype error msg (#37376)

issue: #37151

Signed-off-by: xianliang.li <xianliang.li@zilliz.com>
This commit is contained in:
foxspy 2024-11-04 11:46:28 +08:00 committed by GitHub
parent f54cf41830
commit eaf86f7649
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -473,7 +473,7 @@ func checkTrain(field *schemapb.FieldSchema, indexParams map[string]string) erro
if typeutil.IsVectorType(field.DataType) && indexType != indexparamcheck.AutoIndex {
exist := CheckVecIndexWithDataTypeExist(indexType, field.DataType)
if !exist {
return fmt.Errorf("data type %d can't build with this index %s", field.DataType, indexType)
return fmt.Errorf("data type %s can't build with this index %s", schemapb.DataType_name[int32(field.GetDataType())], indexType)
}
}

View File

@ -864,7 +864,7 @@ func TestCreateSparseUnsupportedIndex(t *testing.T) {
// create unsupported vector index on sparse field
for _, idx := range hp.GenAllFloatIndex(entity.IP) {
_, err := mc.CreateIndex(ctx, client.NewCreateIndexOption(schema.CollectionName, common.DefaultSparseVecFieldName, idx))
common.CheckErr(t, err, false, fmt.Sprintf("data type 104 can't build with this index %v", idx.IndexType()))
common.CheckErr(t, err, false, fmt.Sprintf("data type SparseFloatVector can't build with this index %v", idx.IndexType()))
}
// create scalar index on sparse vector