From c5363c70dbf2bc6112f0e26998843610f90e1246 Mon Sep 17 00:00:00 2001 From: zhagnlu <1542303831@qq.com> Date: Fri, 23 Feb 2024 09:54:53 +0800 Subject: [PATCH] fix: fix upsert using wrong field to compute partition key (#30772) #30607 Signed-off-by: luzhang Co-authored-by: luzhang --- internal/proxy/task_upsert.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/proxy/task_upsert.go b/internal/proxy/task_upsert.go index f8415f6d55..b89c09d954 100644 --- a/internal/proxy/task_upsert.go +++ b/internal/proxy/task_upsert.go @@ -198,8 +198,8 @@ func (it *upsertTask) insertPreExecute(ctx context.Context) error { } if it.partitionKeyMode { - pkFieldSchema, _ := it.schema.GetPkField() - it.partitionKeys, err = getPartitionKeyFieldData(pkFieldSchema, it.upsertMsg.InsertMsg) + fieldSchema, _ := typeutil.GetPartitionKeyFieldSchema(it.schema.CollectionSchema) + it.partitionKeys, err = getPartitionKeyFieldData(fieldSchema, it.upsertMsg.InsertMsg) if err != nil { log.Warn("get partition keys from insert request failed", zap.String("collectionName", collectionName),