mirror of
https://github.com/milvus-io/milvus.git
synced 2026-10-29 01:16:06 +08:00
Element-nullable Array fields and nested Array (`Array<Array<T>>`) struct sub-fields are being built in a stack of PRs. Until the whole stack is merged, the proxy refuses them so that a partly merged master does not expose an incomplete feature. What this PR does: - Adds one helper, `internal/proxy/ddl/array_feature_gate.go`. It rejects a field with `element_nullable=true`, `element_type=Array` or a `type_schema` (only valid on a nested Array) with an input error (`ErrParameterInvalid`, "element_nullable and nested Array fields are not supported yet"). - Calls it in the proxy task `PreExecute` of every request that carries a field schema, after the existing validation of that request: CreateCollection (top-level fields and struct sub-fields), AddCollectionField, AddCollectionStructField, AlterCollectionSchema add requests, and Import / ImportV2 (checked against the target collection schema). REST and SDK requests reach the same tasks. No check is added to rootcoord, datacoord, datanode, querynode, streaming or segcore, so replicated DDL on a CDC secondary is unaffected. - Adds a hidden switch `proxy.enableElementNullAndNestedArray` (default false, not exported to milvus.yaml) that turns the gate off. The tests of the upper layers need the feature, so the switch is turned on in the `internal/proxy/ddl` TestMain, in the `MiniClusterSuite` defaults of `tests/integration`, and in the `user.yaml` of the CI helm values (`tests/_helm/values/e2e/*`, `tests/scripts/values/ci/pr*.yaml`). Behavior change on master: nested Array struct sub-fields, accepted since #51794 (not in any release), are refused while the gate exists. element_nullable was already refused. The gate, the switch and every place that turns it on are removed in one commit after the last layer of the stack. Tests: `array_feature_gate_test.go` checks CreateCollection, AddCollectionStructField and Import (JSON, Parquet, CSV, backup) with nested Array, element-nullable Array and element-nullable ArrayOfVector struct sub-fields, with the switch off (rejected) and on (not rejected by the gate). For AddCollectionField and AlterCollectionSchema, top-level element-nullable and nested Array fields are already refused by the existing field validation before the gate is reached; those two tests only assert that rejection with the gate on. The helpers are also tested directly in both states. Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>