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 <qianya.cheng@zilliz.com>
pull/33805/head
cqy123456 2024-06-12 07:13:55 -05:00 committed by GitHub
parent 9a3e4080f1
commit be3559e022
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View File

@ -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
}

View File

@ -158,7 +158,7 @@ func Test_hnswChecker_CheckValidDataType(t *testing.T) {
},
{
dType: schemapb.DataType_BinaryVector,
errIsNil: false,
errIsNil: true,
},
}