diff --git a/internal/rootcoord/alter_collection_task.go b/internal/rootcoord/alter_collection_task.go index 9585c555b2..7a602d510c 100644 --- a/internal/rootcoord/alter_collection_task.go +++ b/internal/rootcoord/alter_collection_task.go @@ -388,6 +388,17 @@ func ResetFieldProperties(coll *model.Collection, fieldName string, newProps []* return nil } } + for _, structField := range coll.StructArrayFields { + if structField.Name == fieldName { + return merr.WrapErrParameterInvalidMsg("struct field has no properties to alter", fieldName) + } + for i, field := range structField.Fields { + if field.Name == fieldName { + structField.Fields[i].TypeParams = newProps + return nil + } + } + } return merr.WrapErrParameterInvalidMsg("field %s does not exist in collection", fieldName) } @@ -397,6 +408,16 @@ func GetFieldProperties(coll *model.Collection, fieldName string) ([]*commonpb.K return field.TypeParams, nil } } + for _, structField := range coll.StructArrayFields { + if structField.Name == fieldName { + return nil, merr.WrapErrParameterInvalidMsg("struct field has no properties", fieldName) + } + for _, field := range structField.Fields { + if field.Name == fieldName { + return field.TypeParams, nil + } + } + } return nil, merr.WrapErrParameterInvalidMsg("field %s does not exist in collection", fieldName) }