Skip to content

cherry-pick: add test cases for search by id and struct array. (#1749)#1753

Merged
sre-ci-robot merged 1 commit intomilvus-io:2.6from
yongpengli-z:2.6
Feb 4, 2026
Merged

cherry-pick: add test cases for search by id and struct array. (#1749)#1753
sre-ci-robot merged 1 commit intomilvus-io:2.6from
yongpengli-z:2.6

Conversation

@yongpengli-z
Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: yongpengli-z <yongpeng.li@zilliz.com>
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @yongpengli-z, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces significant enhancements to the Milvus V2 Java client's test suite, focusing on advanced data modeling and manipulation capabilities. It provides robust validation for the new Struct Array feature, allowing users to embed and query vector arrays within structured data. Concurrently, it expands the Search functionality to support direct searches by primary key, offering more flexible data retrieval options. Furthermore, the addition of Partial Update tests ensures the reliability of updating specific entity fields, improving data management efficiency. These changes collectively bolster the client's stability and feature completeness.

Highlights

  • New Test Suite for Struct Array Feature: A comprehensive new test file, StructArrayTest.java, has been added to validate the Struct Array feature, including the ability to store and query arrays of vectors within a struct. This covers collection creation, data insertion, index creation on struct vector fields, and various search and query operations.
  • Enhanced Search by Primary Key Functionality: The SearchTest.java file has been significantly extended with new test cases for performing searches using primary keys (both Int64 and VarChar). This includes basic searches, searches with filters, range searches, grouping, pagination, and tests for single/multiple primary keys, as well as error handling for invalid inputs.
  • Introduction of Partial Update Test Cases: The UpsertTest.java file now includes extensive test cases for partial updates. This new functionality allows updating specific fields of existing entities without overwriting the entire record, covering scalar fields, JSON fields, vector fields, and dynamic fields.
  • Utility Method Additions and Modifications: The CommonData.java and CommonFunction.java utility files have been updated to support the new test cases. CommonData now includes constants for struct array fields, while CommonFunction provides new methods for creating collections with VarChar primary keys, generating data for them, and handling struct array collection creation, data generation, and index management.
  • Refined Search Assertions and Data Providers: Assertions in SearchTest.java for BinaryVector, BFloat16Vector, and Float16Vector search results have been made more flexible to account for potential data distribution variations. A new data provider VectorTypeListWithoutSparse was introduced to exclude sparse vectors from certain tests, and topK parameters were updated to limit for API consistency.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mergify mergify Bot added the dco-passed label Jan 30, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a comprehensive set of test cases for new features, including search by ID (for both Int64 and Varchar primary keys) and operations on struct arrays containing vectors. It also introduces tests for the partial update functionality of the upsert operation. The new tests are well-structured, covering a wide range of scenarios including positive, negative, and boundary cases, which significantly improves the test coverage for these features. My review includes a few suggestions to enhance code quality, performance in test helper methods, and the robustness of exception testing.

@mergify mergify Bot added the ci-passed label Jan 30, 2026
@yhmo
Copy link
Copy Markdown
Contributor

yhmo commented Feb 4, 2026

/lgtm
/approve

@sre-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yhmo, yongpengli-z

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

@sre-ci-robot sre-ci-robot merged commit 93065fa into milvus-io:2.6 Feb 4, 2026
5 checks passed
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