fix: support non-float vectors in struct array#3268
fix: support non-float vectors in struct array#3268sre-ci-robot merged 1 commit intomilvus-io:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3268 +/- ##
==========================================
+ Coverage 76.21% 76.25% +0.04%
==========================================
Files 63 63
Lines 13292 13321 +29
==========================================
+ Hits 10130 10158 +28
- Misses 3162 3163 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
e93cd8e to
60d6dd8
Compare
|
@XuanYang-cn PTAL |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SpadeA-Tang, XuanYang-cn The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Search path issue for non-float vectors in struct arrayInsert path works great with this PR! However, the search path still has issues for non-float vectors in struct arrays. Here's the analysis: 1. element_filter (single vector) search — Already supported ✅The existing
Server-side also works — verified with float16 ndarray + element_filter + L2 metric. 2. EmbeddingList (multi-vector) search — Two fixes needed ❌Issue A: In def add(self, embedding):
embedding = np.asarray(embedding) # bytes → 0-D ndarray (shape=())
if embedding.ndim != 1: # 0 != 1 → ValueError
raise ValueError(f"Embedding must be 1D, got shape {embedding.shape}")For non-float vectors (Float16, BFloat16, Int8, Binary), the entity helper stores vectors as Fix: Issue B: In elif dtype == "byte":
pl_type = PlaceholderType.BinaryVector # Missing is_embedding_list check!
pl_values = dataAnd line 1348-1350: elif isinstance(data[0], bytes):
pl_type = PlaceholderType.BinaryVector # Missing is_embedding_list check!
pl_values = dataBoth branches don't check 3. Server-side — OK ✅Verified that Milvus server correctly handles non-float vector search when data is properly serialized:
Test Impact8 search test cases in struct array element search tests are currently marked as |
issue: #3265