wei liu d5eb240f3b
fix: [2.6] reject duplicate primary keys in upsert batch request (#46035)
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>
2025-12-04 14:17:13 +08:00
..