Skip to content

fix(qdrant): support Long type in payload by converting to String #3367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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

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