mirror of
https://github.com/milvus-io/milvus.git
synced 2026-10-28 17:05:53 +08:00
Allow AlterCollectionSchema to append a sub-field to, or drop a sub-field
from, a StructArrayField of a collection that already holds data.
DDL: FieldInfo.struct_path (new milvus-proto field) names the parent
struct; the sub-field is a plain FieldSchema with its raw name. Proxy and
rootcoord validate the same rules (element_nullable=true, no default value,
no protected role, nullable copied from the struct, same max_capacity as
the siblings), rootcoord allocates the field id, stores the s[b] name and
bumps the schema version. Drop takes DropRequest{field_name:"s[b]"} or the
field id, refuses the struct's last sub-field, the collection's last vector
field and function inputs, and cascades the index drop by id. Binding an
index while adding a sub-field is rejected for now.
Rows written before the DDL read the new sub-field as a null row when the
struct row is null and as N null elements otherwise, N taken from a
sibling: the proxy synthesizes compact rows for omitted element-nullable
sub-fields (and rejects unknown sub-field names), the Go readers and
compactors build list rows from a present sibling's offsets, the write
buffer does the same for older insert messages, and segcore backfills
sealed segments through DefaultValueChunkTranslator with the struct's
ArrayOffsets and growing segments through fill_empty_field.
segcore struct offsets now accept element-nullable sub-fields with logical
lengths, pick the provider deterministically (a sub-field with real data, a
scalar Array before a vector array, then the lowest field id; built after all
struct columns are loaded), and growing
Reopen drops the aliases of removed sub-fields and re-picks the
representative. Bump-schema compaction and the packed readers keep struct
membership so a partially present struct is backfilled instead of rejected;
packed binlogs without ChildFields fail explicitly when the schema has
element-nullable sub-fields.
Bulk import, the Go SDK and REST are unchanged in this change.
Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
Milvus repository documentation
This directory contains documentation that must stay close to the Milvus source
tree. Public product documentation belongs in the
milvus-io/milvus-docs repository.
Directory map
| Path | Purpose | Status |
|---|---|---|
agent_guides/ |
Code-backed subsystem architecture, invariants, and debugging guidance | Current |
dev/ |
Contributor-facing engineering rules and development procedures | Current |
design-docs/ |
Design records and their supporting assets | Current and historical |
archive/ |
Superseded documentation retained for historical context | Historical, non-normative |
Documentation that belongs to one component may remain next to that component. Other repository-wide documentation should use one of the directories above.