Skip to content

Conversation

@solnone
Copy link
Contributor

@solnone solnone commented May 29, 2025

Qdrant does not support java.lang.Long as a native payload type. Previously, passing a Long value caused the following exception:

java.lang.IllegalArgumentException: Unsupported Qdrant value type: class java.lang.Long
at org.springframework.ai.vectorstore.qdrant.QdrantValueFactory.value(QdrantValueFactory.java:85)
at org.springframework.ai.vectorstore.qdrant.QdrantValueFactory.lambda$toValueMap$1(QdrantValueFactory.java:46)
...

To resolve this, Long values are now converted to their String representation in QdrantValueFactory. This preserves precision and avoids serialization issues.

Thank you for taking time to contribute this pull request!
You might have already read the [contributor guide][1], but as a reminder, please make sure to:

  • Sign the contributor license agreement
  • Rebase your changes on the latest main branch and squash your commits
  • Add/Update unit tests as needed
  • Run a build and make sure all tests pass prior to submission

Qdrant does not support java.lang.Long as a native payload type.
Previously, passing a Long value caused the following exception:

  java.lang.IllegalArgumentException: Unsupported Qdrant value type: class java.lang.Long
    at org.springframework.ai.vectorstore.qdrant.QdrantValueFactory.value(QdrantValueFactory.java:85)
    at org.springframework.ai.vectorstore.qdrant.QdrantValueFactory.lambda$toValueMap$1(QdrantValueFactory.java:46)
    ...

To resolve this, Long values are now converted to their String representation
in QdrantValueFactory. This preserves precision and avoids serialization issues.

Signed-off-by: Solomon Hsu <[email protected]>
@ilayaperumalg ilayaperumalg self-assigned this May 29, 2025
@ilayaperumalg ilayaperumalg added qdrant vector store bug Something isn't working labels May 29, 2025
@ilayaperumalg ilayaperumalg added this to the 1.1.x milestone May 29, 2025
@ilayaperumalg
Copy link
Member

@solnone Thanks for the PR adding support for Long type

@ilayaperumalg
Copy link
Member

@solnone Thanks for the PR! Could you add a test to verify this?

…tring

Adds a test to ensure that Long values in document metadata are
safely converted to String before being stored in Qdrant.

The test inserts a document with a Long-type "ref_id", performs
a similarity search, and verifies that:
- the result is not empty,
- the retrieved "ref_id" is a String,
- the value matches the original Long when parsed.

Also ensures cleanup by deleting the inserted document from the store.

Signed-off-by: Solomon Hsu <[email protected]>
@ilayaperumalg
Copy link
Member

@solnone Thanks for adding the test. Rebased and merged as f0d4cbf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working qdrant vector store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants