From 2d8234919c58cec61a684949a96b72cb017377ce Mon Sep 17 00:00:00 2001 From: Congqi Xia Date: Mon, 19 Feb 2024 11:58:28 +0800 Subject: [PATCH] enhance: Remove varchar column cannot use auto ID constraint Signed-off-by: Congqi Xia --- client/collection.go | 3 --- client/collection_test.go | 7 ------- 2 files changed, 10 deletions(-) diff --git a/client/collection.go b/client/collection.go index 8f53d13f4..4396eb020 100644 --- a/client/collection.go +++ b/client/collection.go @@ -204,9 +204,6 @@ func (c *GrpcClient) validateSchema(sch *entity.Schema) error { if autoID { return errors.New("only one auto id is available") } - if field.DataType != entity.FieldTypeInt64 { - return errors.New("only int64 column can be auto generated id") - } autoID = true } if field.DataType == entity.FieldTypeJSON { diff --git a/client/collection_test.go b/client/collection_test.go index fc144b35b..6fb3dd1e0 100644 --- a/client/collection_test.go +++ b/client/collection_test.go @@ -374,13 +374,6 @@ func (s *CollectionSuite) TestNewCollection() { err := c.NewCollection(ctx, testCollectionName, testVectorDim, WithPKFieldName("my_pk"), WithPKFieldType(entity.FieldTypeVarChar), WithVectorFieldName("embedding"), WithConsistencyLevel(entity.ClEventually)) s.NoError(err) }) - - s.Run("varchar_autoid", func() { - defer s.resetMock() - - err := c.NewCollection(ctx, testCollectionName, testVectorDim, WithPKFieldType(entity.FieldTypeVarChar), WithAutoID(true)) - s.Error(err) - }) } func (s *CollectionSuite) TestRenameCollection() {