Skip to content

Commit

Permalink
fix: optimize invalid datatype error msg (#37376)
Browse files Browse the repository at this point in the history
issue: #37151

Signed-off-by: xianliang.li <[email protected]>
  • Loading branch information
foxspy authored Nov 4, 2024
1 parent f54cf41 commit eaf86f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/proxy/task_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/go_client/testcases/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eaf86f7

Please sign in to comment.