mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 17:48:29 +08:00
issue: #44320 pr: #45997 Add validation to detect and reject duplicate primary keys within the same upsert batch. This prevents inconsistent behavior where the last duplicate entry would silently overwrite previous entries. Changes: - Add CheckDuplicatePkExist function to detect duplicate primary keys (supports Int64 and VarChar types) - Add generic hasDuplicates helper function for efficient duplicate detection using hashmap - Split fillFieldPropertiesBySchema into validateFieldDataColumns and fillFieldPropertiesOnly for better separation of concerns - Add duplicate PK check in upsertTask.PreExecute before creating UpsertMsg - Add unit tests for duplicate PK detection in task_upsert_test.go and util_test.go - Add Python client tests for duplicate PK scenarios with Int64 and VarChar primary keys Signed-off-by: Wei Liu <wei.liu@zilliz.com>