Skip to content

Commit

Permalink
refactor: Use empty named vectors if vectors are omitted (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 authored Sep 17, 2024
1 parent f986a7d commit 66450ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/io/qdrant/kafka/ValueExtractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.protobuf.InvalidProtocolBufferException;
import io.qdrant.client.grpc.JsonWithInt.Value;
import io.qdrant.client.grpc.Points.NamedVectors;
import io.qdrant.client.grpc.Points.PointId;
import io.qdrant.client.grpc.Points.PointStruct;
import io.qdrant.client.grpc.Points.Vectors;
Expand Down Expand Up @@ -77,7 +78,7 @@ public Vectors getVector() {
Value vectorValue = this.valueMap.get(VECTOR_KEY);

if (vectorValue == null) {
return Vectors.getDefaultInstance();
return Vectors.newBuilder().setVectors(NamedVectors.getDefaultInstance()).build();
}

return VectorsFactory.vectors(vectorValue);
Expand Down

0 comments on commit 66450ce

Please # to comment.