From c04d42bb7ae9cdaaf72bdb6be793b31b4b43cc9f Mon Sep 17 00:00:00 2001 From: Nian Liu Date: Tue, 3 Dec 2024 11:43:30 +0800 Subject: [PATCH] remove auto-id check for upsert as it's supported now Signed-off-by: Nian Liu --- src/main/java/io/milvus/v2/utils/DataUtils.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/java/io/milvus/v2/utils/DataUtils.java b/src/main/java/io/milvus/v2/utils/DataUtils.java index 31f945cfb..feb4458a2 100644 --- a/src/main/java/io/milvus/v2/utils/DataUtils.java +++ b/src/main/java/io/milvus/v2/utils/DataUtils.java @@ -60,13 +60,6 @@ public UpsertRequest convertGrpcUpsertRequest(@NonNull UpsertReq requestParam, DescribeCollectionResp descColl) { String collectionName = requestParam.getCollectionName(); - // currently, not allow to upsert for collection whose primary key is auto-generated - CreateCollectionReq.FieldSchema primaryField = descColl.getCollectionSchema().getField(descColl.getPrimaryFieldName()); - if (primaryField.getAutoID() == Boolean.TRUE) { - throw new MilvusClientException(ErrorCode.INVALID_PARAMS, String.format("Upsert don't support autoID==True, collection: %s", - requestParam.getCollectionName())); - } - // generate upsert request builder MsgBase msgBase = MsgBase.newBuilder().setMsgType(MsgType.Insert).build(); upsertBuilder = UpsertRequest.newBuilder()