Skip to content

Commit f7f14bc

Browse files
committed
Refactor QdrantObjectFactory to allow null metadata values
Signed-off-by: WOONBE <kepull2918@naver.com>
1 parent 161c437 commit f7f14bc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

vector-stores/spring-ai-qdrant-store/src/main/java/org/springframework/ai/vectorstore/qdrant/QdrantObjectFactory.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.ai.vectorstore.qdrant;
1818

19+
import java.util.HashMap;
1920
import java.util.Map;
2021
import java.util.stream.Collectors;
2122

@@ -30,6 +31,7 @@
3031
* Utility methods for building Java objects from io.qdrant.client.grpc.JsonWithInt.Value.
3132
*
3233
* @author Anush Shetty
34+
* @author Heonwoo Kim
3335
* @since 0.8.1
3436
*/
3537
final class QdrantObjectFactory {
@@ -41,7 +43,11 @@ private QdrantObjectFactory() {
4143

4244
public static Map<String, Object> toObjectMap(Map<String, Value> payload) {
4345
Assert.notNull(payload, "Payload map must not be null");
44-
return payload.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> object(e.getValue())));
46+
Map<String, Object> map = new HashMap<>();
47+
for (Map.Entry<String, Value> entry : payload.entrySet()) {
48+
map.put(entry.getKey(), object(entry.getValue()));
49+
}
50+
return map;
4551
}
4652

4753
private static Object object(ListValue listValue) {

0 commit comments

Comments
 (0)