Skip to content

Commit

Permalink
Added exception message if conversion fails during graph creation
Browse files Browse the repository at this point in the history
Signed-off-by: Navneet Verma <navneev@amazon.com>
  • Loading branch information
navneet1v committed Apr 28, 2024
1 parent 3421a67 commit 2b2b08d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ public static KNNCodecUtil.Pair getFloats(BinaryDocValues values) throws IOExcep
String vectorString = new String(bytesref.bytes, 1, bytesref.bytes.length - 1);
String[] array = vectorString.split(",");
vector = new float[array.length];
for (int i = 0; i < array.length; i++) {
vector[i] = Float.parseFloat(array[i]);
try {
for (int i = 0; i < array.length; i++) {
vector[i] = Float.parseFloat(array[i]);
}
} catch (Exception e) {
log.error("Error while converting floats for str: {}", vectorString, e);
}
stopWatch.stop();
log.info("Time taken to deserialize vector with string is : {} ms", stopWatch.totalTime().millis());
Expand Down

0 comments on commit 2b2b08d

Please sign in to comment.