15 Commits

Author SHA1 Message Date
wei liu
f85e86a6ec
fix: change upsert duplicate PK behavior from dedup to error (#45997)
issue: #44320

Replace the DeduplicateFieldData function with CheckDuplicatePkExist
that returns an error when duplicate primary keys are detected in the
same batch, instead of silently deduplicating.

Changes:
- Replace DeduplicateFieldData with CheckDuplicatePkExist in util.go
- Update upsertTask.PreExecute to return error on duplicate PKs
- Simplify helper function from findLastOccurrenceIndices to
hasDuplicates
- Update unit tests to verify the new error behavior
- Add Python integration tests for duplicate PK error cases

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2025-12-04 10:23:11 +08:00
wei liu
d3c95eaa77
enhance: Support partial field updates with upsert API (#42877)
issue: #29735
Implement partial field update functionality for upsert operations,
supporting scalar, vector, and dynamic JSON fields without requiring all
collection fields.

Changes:
- Add queryPreExecute to retrieve existing records before upsert
- Implement UpdateFieldData function for merging data
- Add IDsChecker utility for efficient primary key lookups
- Fix JSON data creation in tests using proper map marshaling
- Add test cases for partial updates of different field types

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2025-08-19 11:15:45 +08:00
ThreadDao
d1e4243e0b
test: new cases for goclient nullable and default value (#43879)
issue: #33419

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2025-08-16 17:23:44 +08:00
Xianhui Lin
ee053fa244
enhance: remove unnecessary sleep in query and upsert test cases (#43102)
remove unnecessary sleep in query and upsert test cases
https://github.com/milvus-io/milvus/issues/36995

Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
2025-07-04 10:08:52 +08:00
ThreadDao
afb1b85857
test: add go cases for upsert autoid row (#41249)
issue: #40816

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2025-04-14 17:56:31 +08:00
Xianhui Lin
3bc24c264f
enhance: Add json key inverted index in stats for optimization (#38039)
Add json key inverted index in stats for optimization
https://github.com/milvus-io/milvus/issues/36995

---------

Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
Co-authored-by: luzhang <luzhang@zilliz.com>
2025-04-10 15:20:28 +08:00
ThreadDao
5f71bb2a41
test: Split gosdk cases into different packages and add rg cases (#39694)
issue: #33419

---------

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2025-02-26 16:27:59 +08:00
congqixia
ce480c3f57
enhance: [GoSDK] Use pkg v2 module path (#40134)
Related to #39095
Previous PR #39990 update pkg module path using "/v2" package name, this
PR update milvusclient go sdk dependency for this update

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-02-25 10:33:56 +08:00
Yinzuo Jiang
1ce609834a
feat: [GoSDK] fp32 <-> fp16/bf16 vector conversion (#37978)
Add the following methods for convenient fp32 vector <-> fp16/bf16
vector conversion

fp32 <-> fp16/bf16 vector conversion:

- `func (fv FloatVector) ToFloat16Vector() Float16Vector`
- `func (fv FloatVector) ToBFloat16Vector() BFloat16Vector`
- `func (fv Float16Vector) ToFloat32Vector() FloatVector`
- `func (fv BFloat16Vector) ToFloat32Vector() FloatVector`

`columnBasedDataOption`:

- `func (opt *columnBasedDataOption) WithFloat16VectorColumn(colName
string, dim int, data [][]float32) *columnBasedDataOption`
- `func (opt *columnBasedDataOption) WithBFloat16VectorColumn(colName
string, dim int, data [][]float32) *columnBasedDataOption`

`ColumnFloat16Vector`/`ColumnBFloat16Vector`:

- `func NewColumnFloat16VectorFromFp32Vector(fieldName string, dim int,
data [][]float32) *ColumnFloat16Vector`
- `func NewColumnBFloat16VectorFromFp32Vector(fieldName string, dim int,
data [][]float32) *ColumnBFloat16Vector`
- support []float32 or `entity.FloatVector` in
    - `func (c *ColumnFloat16Vector) AppendValue(i interface{}) error`
    - `func (c *ColumnFloat16Vector) AppendValue(i interface{}) error`

issue: #37448

Signed-off-by: Yinzuo Jiang <yinzuo.jiang@zilliz.com>
Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-11-29 08:00:37 +08:00
congqixia
6b23e668b0
test: Update go_client version & update latest changes (#37793)
Related to #37768

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-11-26 10:26:40 +08:00
congqixia
11f4fe0177
enhance: [GoSDK] move client pkg go files to sub one (#37492)
Related to #31293

Client source files under client pkg cannot be evaluate correctly by
codecov. This PR moves them to `milvusclient` sub-package to fix this
issue and follow go major version best practice.

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-11-08 07:32:26 +08:00
congqixia
e5948bd039
enhance: [GoSDK] Use variadic params for options (#36912)
Use variadic parameter function for options make client options easier
to use.

Related to #31293

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-10-16 19:33:23 +08:00
ThreadDao
a62118ca33
test: update cases for index describe and upsert with autoID (#35191)
issue: #33419

---------

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2024-08-05 18:00:16 +08:00
ThreadDao
67747245f4
test: add test cases for gosdk v2 index (#34431)
issue: #33419 
- Add test cases for gosdk v2 index
- Add sparse index for go client

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2024-07-05 09:10:09 +08:00
ThreadDao
e4cece8de8
test: add cases for gosdk v2 upsert (#34400)
- test: add cases for gosdk v2 upsert
- test: update clientv2 to client reference

issue: #33419

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2024-07-04 14:26:09 +08:00