From be3559e022e6206854b1b5ad93a48a5df7157bea Mon Sep 17 00:00:00 2001 From: cqy123456 <39671710+cqy123456@users.noreply.github.com> Date: Wed, 12 Jun 2024 07:13:55 -0500 Subject: [PATCH] enhance: proxy check hnsw with sparse is legal (#33697) issue:https://github.com/milvus-io/milvus/issues/22837 related:https://github.com/milvus-io/milvus/pull/33653 Signed-off-by: cqy123456 --- pkg/util/indexparamcheck/hnsw_checker.go | 5 ++--- pkg/util/indexparamcheck/hnsw_checker_test.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) 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, }, }