spring-projects/spring-ai · warning

Unsupported value type

Error message

Unsupported value type: ${value.getKindCase()}

What it means

QdrantObjectFactory.object() converts a Qdrant protobuf Value into a Java object via a switch on KindCase. When a value kind is not in the handled set, it warns 'Unsupported value type' and yields null, so the payload field silently becomes null in the returned Document metadata.

Solutions

  1. Store integers as doubles (or strings) in Qdrant payloads so they map to DOUBLE_VALUE
  2. Check the logged KindCase and upgrade spring-ai-qdrant-store to a version handling that kind
  3. Add a custom payload converter / post-process Documents to restore the affected metadata field
  4. File/verify against the Spring AI issue tracker if a supported kind (e.g. INT64_VALUE) is unhandled

Example fix

// before
payload.put("count", 42); // Integer -> INT64_VALUE, reads back as null

// after
payload.put("count", 42.0); // Double -> DOUBLE_VALUE, round-trips
Defensive patterns

Strategy: type-guard

Validate before calling

// check metadata after reading from Qdrant
if (doc.getMetadata().get("count") == null && expectedCount != null) {
    logger.warn("Qdrant payload field 'count' was dropped as unsupported value kind");
}

Type guard

Object v = doc.getMetadata().get(fieldName);
if (v instanceof Integer) {
    // likely came back as null from Qdrant; store doubles instead
}

Prevention

When it happens

Trigger: Reading points from Qdrant whose payload contains a Value kind not covered by the switch (only Double, Bool, List, Struct, Null handled) — e.g. Integer (INT64_VALUE) values or newer Qdrant payload types depending on client version.

Common situations: Storing integer payload values in Qdrant and reading them back (metadata becomes null); using a newer Qdrant server/client with additional value kinds; version drift between qdrant-client protobuf definitions and the converter.

Related errors


AI-assisted analysis of spring-projects/spring-ai@98a7beda4f (2026-09-11). Data as JSON: /api/errors/dca7f16e9e96023d. Report an issue: GitHub.

Appendix: source

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

		return map;
	}

	private static Object object(ListValue listValue) {
		return listValue.getValuesList().stream().map(QdrantObjectFactory::object).toList();
	}

	private static @Nullable Object object(Value value) {

		return switch (value.getKindCase()) {
			case INTEGER_VALUE -> value.getIntegerValue();
			case STRING_VALUE -> value.getStringValue();
			case DOUBLE_VALUE -> value.getDoubleValue();
			case BOOL_VALUE -> value.getBoolValue();
			case LIST_VALUE -> object(value.getListValue());
			case STRUCT_VALUE -> toObjectMap(value.getStructValue().getFieldsMap());
			case NULL_VALUE -> null;
			default -> {
				logger.warn("Unsupported value type: " + value.getKindCase());
				yield null;
			}
		};

	}

}

View on GitHub (pinned to 98a7beda4f)