diff --git a/pkg/util/indexparamcheck/hnsw_checker.go b/pkg/util/indexparamcheck/hnsw_checker.go index 56146e2468..6ff556f22b 100644 --- a/pkg/util/indexparamcheck/hnsw_checker.go +++ b/pkg/util/indexparamcheck/hnsw_checker.go @@ -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 } diff --git a/pkg/util/indexparamcheck/hnsw_checker_test.go b/pkg/util/indexparamcheck/hnsw_checker_test.go index e2e374e0c9..bcb7c482a1 100644 --- a/pkg/util/indexparamcheck/hnsw_checker_test.go +++ b/pkg/util/indexparamcheck/hnsw_checker_test.go @@ -158,7 +158,7 @@ func Test_hnswChecker_CheckValidDataType(t *testing.T) { }, { dType: schemapb.DataType_BinaryVector, - errIsNil: false, + errIsNil: true, }, }