oscerd opened a new pull request, #25855:
URL: https://github.com/apache/camel/pull/25855

   ## Issue
   [CAMEL-24534](https://issues.apache.org/jira/browse/CAMEL-24534)
   
   ## Problem
   `QdrantEmbeddingsDataTypeTransformer` maps document metadata into the Qdrant 
point payload with:
   
   ```java
   metadata.toMap()
           .forEach((key, value) -> builder.putPayload(key, 
ValueFactory.value((String) value)));
   ```
   
   The unchecked `(String) value` cast throws `ClassCastException` as soon as a 
metadata value is not a
   `String`. This happens routinely in practice: LangChain4j document splitters 
populate numeric metadata
   such as the chunk index and page number, so a normal ingestion pipeline that 
stores metadata fails at
   runtime.
   
   ## Fix
   Convert each metadata value to the matching Qdrant `Value` type — boolean, 
integer (`Integer`/`Long`),
   double (other `Number`), otherwise `String` — mirroring how the pgvector 
sibling transformer already
   handles `Number`/`Boolean`.
   
   ## Testing
   - New `QdrantEmbeddingsDataTypeTransformerTest` transforms a `TextSegment` 
carrying a String and
     numeric metadata and asserts the payload keeps the string as a string and 
the numbers as
     integer/double values (previously this threw `ClassCastException`).
   - `mvn -Psourcecheck validate` green.
   
   _Claude Code on behalf of oscerd_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to