mirror of
https://github.com/milvus-io/milvus.git
synced 2026-07-21 10:15:43 +00:00
Fixes #50424 ## Summary This PR uses the `DropFunctionOutputFields` request flag to let `AlterCollectionSchema` distinguish two client-side drop paths: - `drop_collection_function` detaches the function and keeps its output fields as normal schema fields. - `drop_function_field` sets the flag and cascades supported BM25/MinHash output fields. MinHash detach keeps the output field because the MinHash signature is a materialized `BinaryVector` field. Insert and compaction paths persist the generated signature, raw retrieval is only blocked for BM25 function outputs, and after detach the MinHash output field is kept with `IsFunctionOutput=false` so it can stand alone as a normal vector field. The proxy validation and RootCoord schema mutation logic now follow the requested semantics, with tests covering detach-only and output-field-drop behavior. ## Tests - `make generated-proto-without-cpp` - `make` - `go test -v -count=1 -tags dynamic,test -gcflags="all=-N -l" ./internal/proxy -run "TestAlterCollectionSchemaTask_PreExecute|TestValidateDropFunction" -timeout 300s` - `go test -v -count=1 -tags dynamic,test -gcflags="all=-N -l" ./internal/rootcoord -run "TestBuildSchemaForDetachFunction|TestBuildSchemaForDropFunctionField" -timeout 300s` - `/Users/zilliz/dev/milvus_py`: `pytest test_drop_collection_field.py::test_drop_function_field_bm25_cascades_output_field test_drop_collection_field.py::test_drop_collection_function_detaches_minhash_output_field test_drop_collection_field.py::test_drop_whole_struct_array_field_basic -v -s` Signed-off-by: sijie-ni-0214 <sijie.ni@zilliz.com>
Go MilvusClient
Go MilvusClient for Milvus. To contribute code to this project, please read our contribution guidelines first.
Getting started
Prerequisites
Go 1.24.12 or higher
Install Milvus Go SDK
-
Use
go getto install the latest version of the Milvus Go SDK and dependencies:go get -u github.com/milvus-io/milvus/client/v2 -
Include the Go MilvusClient in your application:
import "github.com/milvus-io/milvus/client/v2/milvusclient" //...other snippet ... ctx, cancel := context.WithCancel(context.Background()) defer cancel() milvusAddr := "YOUR_MILVUS_ENDPOINT" cli, err := milvusclient.New(ctx, &milvusclient.ClientConfig{ Address: milvusAddr, }) if err != nil { // handle error } // Do your work with milvus client
API Documentation
Refer to https://milvus.io/api-reference/go/v2.5.x/About.md for the Go SDK API documentation.
Code format
The Go source code is formatted using gci & gofumpt. Please run make lint-fix before sumbit a PR.