Andrea Cosentino created CAMEL-24534:
----------------------------------------
Summary: camel-qdrant: the embeddings data-type transformer casts
every metadata value to String
Key: CAMEL-24534
URL: https://issues.apache.org/jira/browse/CAMEL-24534
Project: Camel
Issue Type: Bug
Components: camel-qdrant
Reporter: Andrea Cosentino
Assignee: Andrea Cosentino
Fix For: 4.23.0
QdrantEmbeddingsDataTypeTransformer (around lines 56-58) maps document metadata
into the Qdrant point payload with:
metadata.toMap().forEach((k, v) -> builder.putPayload(k,
ValueFactory.value((String) v)));
The unchecked (String) v cast throws ClassCastException as soon as a metadata
value is not a String. This happens routinely in practice because langchain4j
document splitters populate numeric metadata such as the chunk index and page
number, so a normal ingestion pipeline that stores metadata will fail at
runtime.
The pgvector sibling transformer handles Number/Boolean values in addition to
String. Fix: branch on the value type (String / Number / Boolean) and build the
matching Qdrant Value via ValueFactory, or fall back to String.valueOf(v) for
unknown types.
_Claude Code on behalf of oscerd_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)