opendistro-for-elasticsearch / k-NN

🆕 A machine learning plugin which supports an approximate k-NN search algorithm for Open Distro.
https://opendistro.github.io/
Apache License 2.0
277 stars 55 forks source link

Add dimension validation to ANN QueryBuilder #332

Closed jmazanec15 closed 3 years ago

jmazanec15 commented 3 years ago

Issue #, if available:

211

Description of changes: Adds a dimension validation check in QueryBuilder class. This change catches invalid query dimensions sooner to prevent potential crash in JNI.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

codecov[bot] commented 3 years ago

Codecov Report

Merging #332 (f9a5434) into main (4a5ed78) will increase coverage by 0.07%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #332      +/-   ##
============================================
+ Coverage     81.03%   81.10%   +0.07%     
- Complexity      404      406       +2     
============================================
  Files            62       62              
  Lines          1529     1535       +6     
  Branches        139      141       +2     
============================================
+ Hits           1239     1245       +6     
  Misses          241      241              
  Partials         49       49              
Impacted Files Coverage Δ Complexity Δ
...troforelasticsearch/knn/index/KNNQueryBuilder.java 68.81% <100.00%> (+2.15%) 19.00 <3.00> (+2.00)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4a5ed78...f9a5434. Read the comment docs.