mirror of
https://github.com/milvus-io/milvus.git
synced 2026-07-21 18:25:44 +00:00
issue: #50235 ### What problem does this PR solve? This PR adds API support for dynamically adding StructArray fields to an existing collection, aligned with the existing Python SDK API shape. ### What is changed? - Add Go SDK `Client.AddCollectionStructField(...)` and `NewAddCollectionStructFieldOption(...)`. - Convert Go SDK StructArray field schema into `AddCollectionStructFieldRequest`. - Preserve StructArray parent `nullable` and `max_capacity` when converting schemas and describing collections. - Add REST v2 endpoint: - `POST /v2/vectordb/collections/struct_fields/add` - Reject StructArray payloads from the ordinary REST v2 field endpoint: - `POST /v2/vectordb/collections/fields/add` - Support REST v2 StructArray add payloads using both: - `dataType: "Array", elementDataType: "Struct"` - `dataType: "ArrayOfStruct"` - Add Go SDK and REST v2 regression coverage. ### Verification - `milvus-dev-cli go-ut local . -b master -t internal/distributed/proxy/httpserver -k 'TestAddCollectionFieldSuite' -f` - `ut-go-local-zhuwenxi-issue-50235-cbec6c2-26ef323b` - `milvus-dev-cli build local . -b master -f` - `build-local-zhuwenxing-issue-50235-clea-cbec6c2` - `milvus-dev-cli deploy create build-local-zhuwenxing-issue-50235-clea-cbec6c2 --name issue-50235-struct-add` - `pytest -q testcases/test_collection_operations.py::TestCollectionAddField::test_add_struct_array_field --endpoint http://10.100.36.203:19530 --token root:Milvus --minio_host 10.100.36.198` - `2 passed` --------- Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>