Skip to content
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

PGVector Should not Force UUID on ID column #1856

Open
dpresonate opened this issue Dec 3, 2024 · 1 comment
Open

PGVector Should not Force UUID on ID column #1856

dpresonate opened this issue Dec 3, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@dpresonate
Copy link

dpresonate commented Dec 3, 2024

I am using PGVector to store my vector embeddings and this works fine when fetching. Our vectordb was populated through a non spring-ai script and we are not conforming to a UUID as the id of the record and are instead using our own internal key. When I try to add/update a document in our table, I am getting the following error:

java.lang.IllegalArgumentException: Invalid UUID string: A101750
	at java.base/java.util.UUID.fromString1(UUID.java:282)
	at java.base/java.util.UUID.fromString(UUID.java:260)
	at org.springframework.ai.vectorstore.PgVectorStore$1.setValues(PgVectorStore.java:216)
	at org.springframework.jdbc.core.JdbcTemplate.lambda$getPreparedStatementCallback$6(JdbcTemplate.java:1603)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:658)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:701)
	at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:1047)

And it is due to the following code in PgVectorStore.java:

StatementCreatorUtils.setParameterValue(ps, 1, SqlTypeValue.TYPE_UNKNOWN,

Why is this enforced to be a UUID? Can this be changed to allow any type? I would like to use the convenience of the VectorStore abstraction to handle embedding and everything for me, but will have to use a workaround with it in the current state.

@markpollack
Copy link
Member

Excellent point - there are many of the vector store impls that need to 'meet in the middle' (taken from ORM terminology).
We will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants