fix: fix upsert using wrong field to compute partition key (#30772)

#30607

Signed-off-by: luzhang <luzhang@zilliz.com>
Co-authored-by: luzhang <luzhang@zilliz.com>
This commit is contained in:
zhagnlu 2024-02-23 09:54:53 +08:00 committed by GitHub
parent 16b4c9a79e
commit c5363c70db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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),