-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix equals and hashCode methods for KNNQuery and KNNQueryBuilder #1397
Fix equals and hashCode methods for KNNQuery and KNNQueryBuilder #1397
Conversation
Thanks @bugmakerrrrrr for the fix. Overall, it looks good to me. Could you add the fix to the changelog for 2.x? https://github.com/opensearch-project/k-NN/blob/main/CHANGELOG.md#bug-fixes-1 Also, did you run into a bug for this when running OpenSearch? |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1397 +/- ##
============================================
- Coverage 85.03% 84.88% -0.16%
+ Complexity 1275 1274 -1
============================================
Files 167 167
Lines 5179 5186 +7
Branches 483 491 +8
============================================
- Hits 4404 4402 -2
- Misses 571 575 +4
- Partials 204 209 +5 ☔ View full report in Codecov by Sentry. |
@bugmakerrrrrr thank you for your contribution. I do have couple of asks:
|
7202433
to
5f1867d
Compare
No, I just find this bug when I read the code. |
You don't need to specify prefix |
Signed-off-by: panguixin <[email protected]>
Signed-off-by: panguixin <[email protected]>
5f1867d
to
469c1f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: John Mazanec <[email protected]>
cc9efc1
Signed-off-by: panguixin <[email protected]> (cherry picked from commit 89fc267)
Description
The
equals
andhashCode
implementations ofKNNQuery
andKNNQueryBuilder
are missing some fields (indexName
andfilterQuery
forKNNQuery
,filter
andignoreUnmapped
forKNNQueryBuilder
) and are not using the correct array comparison/hash method.The error in the relevant unit test is as follows:
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.