32 Commits

Author SHA1 Message Date
congqixia
6c8e11da4f
feat: [GoSDK] add QueryIterator support for Go client (#46633)
Related to #31293

Implement QueryIterator for the Go SDK to enable efficient iteration
over large query result sets using PK-based pagination.

Key changes:
- Add QueryIterator interface and implementation with PK-based
pagination
- Support Int64 and VarChar primary key types for pagination filtering
- Add QueryIteratorOption with batchSize, limit, filter, outputFields
config
- Fix ResultSet.Slice to handle Query results without IDs/Scores
- Add comprehensive unit tests and integration tests

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
- Core invariant: the iterator requires the collection primary key (PK)
to be present in outputFields so PK-based pagination and accurate row
counting work. The constructor enforces this by appending the PK to
outputFields when absent, and all pagination (lastPK tracking, PK-range
filters) and ResultCount calculations depend on that guaranteed PK
column.

- New capability: adds a public QueryIterator API (Client.QueryIterator,
QueryIterator interface, QueryIteratorOption) that issues server-side
Query RPCs in configurable batches and implements PK-based pagination
supporting Int64 and VarChar PKs, with options for batchSize, limit,
filter, outputFields and an upfront first-batch validation to fail fast
on invalid params.

- Removed/simplified logic: ResultSet.Slice no longer assumes IDs and
Scores are always present — it branches on presence of IDs (use IDs
length when non-nil; otherwise derive row count from Fields[0]) and
guards Scores slicing. This eliminates redundant/unsafe assumptions and
centralizes correct row-count logic based on actual returned fields.

- No data loss or behavior regression: pagination composes the user
filter with a PK-range filter and always requests the PK field, so
lastPK is extracted from a real column and fetchNextBatch only advances
when rows are returned; EOF is returned only when the server returns no
rows or iterator limit is reached. ResultSet.Slice guards prevent panics
for queries that lack IDs/Scores; Query RPC → ResultSet.Fields remains
the authoritative path for row data, so rows are not dropped and
existing query behavior is preserved.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-12-27 01:43:20 +08:00
Zhen Ye
309d564796
enhance: support collection and index with WAL-based DDL framework (#45033)
issue: #43897

- Part of collection/index related DDL is implemented by WAL-based DDL
framework now.
- Support following message type in wal, CreateCollection,
DropCollection, CreatePartition, DropPartition, CreateIndex, AlterIndex,
DropIndex.
- Part of collection/index related DDL can be synced by new CDC now.
- Refactor some UT for collection/index DDL.
- Add Tombstone scheduler to manage the tombstone GC for collection or
partition meta.
- Move the vchannel allocation into streaming pchannel manager.

---------

Signed-off-by: chyezh <chyezh@outlook.com>
2025-10-30 14:24:08 +08:00
cai.zhang
19346fa389
feat: Geospatial Data Type and GIS Function support for milvus (#44547)
issue: #43427

This pr's main goal is merge #37417 to milvus 2.5 without conflicts.

# Main Goals

1. Create and describe collections with geospatial type
2. Insert geospatial data into the insert binlog
3. Load segments containing geospatial data into memory
4. Enable query and search can display  geospatial data
5. Support using GIS funtions like ST_EQUALS in query
6. Support R-Tree index for geometry type

# Solution

1. **Add Type**: Modify the Milvus core by adding a Geospatial type in
both the C++ and Go code layers, defining the Geospatial data structure
and the corresponding interfaces.
2. **Dependency Libraries**: Introduce necessary geospatial data
processing libraries. In the C++ source code, use Conan package
management to include the GDAL library. In the Go source code, add the
go-geom library to the go.mod file.
3. **Protocol Interface**: Revise the Milvus protocol to provide
mechanisms for Geospatial message serialization and deserialization.
4. **Data Pipeline**: Facilitate interaction between the client and
proxy using the WKT format for geospatial data. The proxy will convert
all data into WKB format for downstream processing, providing column
data interfaces, segment encapsulation, segment loading, payload
writing, and cache block management.
5. **Query Operators**: Implement simple display and support for filter
queries. Initially, focus on filtering based on spatial relationships
for a single column of geospatial literal values, providing parsing and
execution for query expressions.Now only support brutal search
7. **Client Modification**: Enable the client to handle user input for
geospatial data and facilitate end-to-end testing.Check the modification
in pymilvus.

---------

Signed-off-by: Yinwei Li <yinwei.li@zilliz.com>
Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
Co-authored-by: ZhuXi <150327960+Yinwei-Yu@users.noreply.github.com>
2025-09-28 19:43:05 +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
ThreadDao
b3cff64bff
test: new search iterator go client cases (#43771)
issue: #33419

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2025-08-07 18:55:40 +08:00
qixuan
1cd593b673
test:add go sdk case for add field (#43033)
issue: #42126

Signed-off-by: qixuan <673771573@qq.com>
2025-07-09 18:20:47 +08:00
zhuwenxing
0d2d2c9064
test: add phrase match test in go client (#39782)
/kind improvement

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-03-26 15:32:21 +08:00
ThreadDao
aaf8ddcec6
test: add cases for go client rbac APIs (#40352)
issue: #33419
- add cases for go client rbac APIs
- add dbName params for grant/revoke v1 & v2 api
- add dbName in GrantItem

---------

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2025-03-13 14:28:08 +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
ThreadDao
c1b4bae130
test: add go-sdk cases for collection related APIs (#39537)
issue: 33419
- add cases for: RenameCollection, CollectionProperties,
GetCollectionStats, fast collection

---------

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2025-02-11 13:54:45 +08:00
zhuwenxing
ee87e4d0b6
test: add go-sdk cases for full text search (#39570)
/kind improvement

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
Signed-off-by: zhuwenxing <wxzhuyeah@gmail.com>
2025-02-10 10:32:45 +08:00
ThreadDao
e02fb41db8
test: add go-sdk cases for database properties (#39484)
issue: #33419 
- Add test cases for database properties
- Fixed typo AlterDatabaseProperies to AlterDatabaseProperties
- Rename UsingDatabase to UseDatabase
- Rename ListDatabases to ListDatabase

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2025-01-23 14:29:16 +08:00
cai.zhang
ee9a2793da
fix: [skip-e2e] Remove valid expressions from invalid expressions (#39012)
issue: #39014

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
2025-01-06 18:06:54 +08:00
Patrick Weizhi Xu
d3a5282eaa
enhance: add param for tuning max VARCHAR length and restore limit to 65535 (#38884)
issue: #38882 

Signed-off-by: Patrick Weizhi Xu <weizhi.xu@zilliz.com>
(cherry picked from commit 8e740e004151dd2c11918aad2857c1c8d1bd98f5)
2025-01-02 14:42:53 +08:00
Xianhui Lin
90de37e60a
enhance: field stringtype maxlength raise to 1M (#38592)
enhance: field stringtype maxlength raise to 1M
issue: https://github.com/milvus-io/milvus/issues/37436

Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
2024-12-20 14:32:45 +08:00
Bingyi Sun
894c203f27
enhance: allow hyphen in partition name (#38494)
Signed-off-by: sunby <sunbingyi1992@gmail.com>
2024-12-18 15:04:45 +08:00
ThreadDao
8794ec966e
test: add go case for groupby search (#38411)
issue: #33419

---------

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2024-12-16 10:44:43 +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
cai.zhang
2ef6cbbf59
feat: The expression supports filling elements through templates (#37033)
issue: #36672

The expression supports filling elements through templates, which helps
to reduce the overhead of parsing the elements.

---------

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
2024-10-31 14:20:22 +08:00
Yinzuo Jiang
3628593d20
feat: Implement custom function module in milvus expr (#36560)
OSPP 2024 project:
https://summer-ospp.ac.cn/org/prodetail/247410235?list=org&navpage=org

Solutions:

- parser (planparserv2)
    - add CallExpr in planparserv2/Plan.g4
    - update parser_visitor and show_visitor
- grpc protobuf
    - add CallExpr in plan.proto
- execution (`core/src/exec`)
- add `CallExpr` `ValueExpr` and `ColumnExpr` (both logical and
physical) for function call and function parameters
- function factory (`core/src/exec/expression/function`)
    - create a global hashmap when starting milvus (see server.go)
- the global hashmap stores function signatures and their function
pointers, the CallExpr in execution engine can get the function pointer
by function signature.
- custom functions
    - empty(string)
    - starts_with(string, string)
- add cpp/go unittests and E2E tests

closes: #36559

Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-10-25 15:25:30 +08:00
ThreadDao
a90133cdf5
test: Optimize sparse vector case (#35661)
/kind improvement

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2024-08-26 14:54:57 +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
congqixia
3333160b8d
enhance: Fix lint issues from recent PRs (#34482)
See also #34483
Some lint issues are introduced due to lack of static check run. This PR
fixes these problems.

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-07-09 10:06:24 +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
be23495233
test: add cases got gosdk v2 search and databases (#34204)
issue: #33952 #33627 #33419

---------

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2024-06-27 09:40:08 +08:00
ThreadDao
a77e2951af
test: add cases for go milvusclient query (#33884)
issue: #33419

---------

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2024-06-26 09:52:04 +08:00
congqixia
35ea775c14
enhance: Add rules and fix for go_client e2e code style (#34033)
See also #31293

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-06-21 10:32:02 +08:00
ThreadDao
9e99f960ab
test: add cases for go milvusclient delete (#33777)
issue: #33419

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2024-06-13 14:43:57 +08:00
ThreadDao
3729d2c8e7
feat: add test case for go client insert (#33603)
issue: #33419

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2024-06-07 14:47:52 +08:00
ThreadDao
ac5e098e13
feat: Add e2e test cases for GoSDK (#33378)
- Add e2e test cases for Go `milvusclient`
- Fix client SparseEmbedding to vector
issue: #33419

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2024-06-04 10:57:47 +08:00