Skip to content

feat: add type params support to StructFieldSchema - #620

Merged
sre-ci-robot merged 1 commit into
milvus-io:masterfrom
yhmo:struct-field-type-params
Oct 22, 2026
Merged

sre-ci-robot merged 1 commit into
milvus-io:masterfrom
yhmo:struct-field-type-params

Conversation

@yhmo

@yhmo yhmo commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add struct-level type_params support to StructFieldSchema (e.g. mmap.enabled, warmup), matching Java (StructFieldSchema.typeParams on master/3.0) and PyMilvus (wire key mmap.enabled after pymilvus normalizes the mmap_enabled kwarg).

Changes

  • src/include/milvus/types/StructFieldSchema.h / src/impl/types/StructFieldSchema.cpp: add TypeParams(), SetTypeParams(const& / &&), fluent AddTypeParam(), mirroring FieldSchema; header docs note the merge/no-overwrite semantics.
  • src/impl/utils/TypeUtils.cpp: wire struct-level type params in both proto directions — SDK→proto (ConvertStructFieldSchema) writes to StructArrayFieldSchema.type_params; proto→SDK reads them back (so DescribeCollection returns them).
  • Tests: TestStructFieldSchema.cpp and TestTypeUtils.cpp cover the new API and both conversions, using the server-recognized mmap.enabled wire key.

Background

StructArrayFieldSchema.type_params exists in milvus-proto since v2.6.6; Milvus server 2.6.6+ propagates struct-level mmap.enabled/warmup to sub-fields at load time (querycoord applyCollectionMmapSetting/applyCollectionWarmupSetting). C++ SDK was the only SDK missing this passthrough.

Copilot AI balanced review requested due to automatic review settings October 22, 2026 08:14
@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yhmo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@mergify

mergify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

Comment thread test/ut/types/TestStructFieldSchema.cpp Outdated
Comment thread src/include/milvus/types/StructFieldSchema.h
Support struct-level type_params (e.g. mmap.enabled, warmup) on
StructFieldSchema, mirroring FieldSchema and matching Java/pymilvus.
Type params are written to proto StructArrayFieldSchema.type_params on
create/add-field and read back on describe, allowing Milvus 2.6.6+
server to propagate mmap/warmup settings to struct sub-fields.

Signed-off-by: yhmo <yihua.mo@zilliz.com>
@yhmo
yhmo force-pushed the struct-field-type-params branch from 7bf01c5 to be3d419 Compare October 22, 2026 08:59
@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.81%. Comparing base (a0592aa) to head (be3d419).
⚠️ Report is 172 commits behind head on master.

Files with missing lines Patch % Lines
src/impl/types/StructFieldSchema.cpp 81.81% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #620       +/-   ##
===========================================
+ Coverage   53.47%   89.81%   +36.34%     
===========================================
  Files          52      436      +384     
  Lines        4432    17817    +13385     
  Branches        0     1925     +1925     
===========================================
+ Hits         2370    16003    +13633     
+ Misses       2062     1811      -251     
- Partials        0        3        +3     
Files with missing lines Coverage Δ
src/impl/utils/TypeUtils.cpp 90.41% <100.00%> (ø)
src/impl/types/StructFieldSchema.cpp 96.00% <81.81%> (ø)

... and 451 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yhmo yhmo added the lgtm label Oct 22, 2026
@mergify mergify Bot added the ci-passed label Oct 22, 2026
@sre-ci-robot
sre-ci-robot merged commit ca30554 into milvus-io:master Oct 22, 2026
12 checks passed
@yhmo
yhmo deleted the struct-field-type-params branch October 22, 2026 10:45
@yhmo yhmo mentioned this pull request Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants