Skip to content

Commit

Permalink
enhance: proxy check hnsw with sparse is legal
Browse files Browse the repository at this point in the history
Signed-off-by: cqy123456 <qianya.cheng@zilliz.com>
  • Loading branch information
cqy123456 committed Jun 6, 2024
1 parent 4dd0c54 commit 3f3d8fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions pkg/util/indexparamcheck/hnsw_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ func (c hnswChecker) CheckTrain(params map[string]string) error {
}

func (c hnswChecker) CheckValidDataType(dType schemapb.DataType) error {
// TODO(SPARSE) we'll add sparse vector support in HNSW later in cardinal
if !typeutil.IsDenseFloatVectorType(dType) {
return fmt.Errorf("HNSW only support float vector data type")
if !typeutil.IsVectorType(dType) {
return fmt.Errorf("can't build hnsw in not vector type.")
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/indexparamcheck/hnsw_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func Test_hnswChecker_CheckValidDataType(t *testing.T) {
},
{
dType: schemapb.DataType_BinaryVector,
errIsNil: false,
errIsNil: true,
},
}

Expand Down

0 comments on commit 3f3d8fa

Please sign in to comment.