Code: Select all
CREATE TABLE IF NOT EXISTS vector_store (
id uuid DEFAULT uuid_generate_v4() PRIMARY KEY,
content text,
metadata jsonb,
embedding vector(1024),
created_at timestamptz DEFAULT now()
);
Code: Select all
@Entity
@Table(name = "vector_store")
public class Document {
@Id
@Column(columnDefinition = "uuid")
private UUID id;
@Column(columnDefinition = "text")
private String content;
@JdbcTypeCode(SqlTypes.JSON)
@Column(columnDefinition = "jsonb")
private LogMetadata metadata;
@JdbcTypeCode(SqlTypes.VECTOR)
@Column(columnDefinition = "vector(1024)")
@Array(length = 1024)
private double[] embedding;
// getters and setters
}
Code: Select all
public List fetchAllDocuments() {
return documentRepository.findAll();
}
Code: Select all
org.hibernate.type.SerializationException: could not deserialize
...
java.io.StreamCorruptedException: invalid stream header: 5B2D302E
Ich habe es auch mit SqlTypes.VECTOR_FLOAT64 versucht, aber ohne Erfolg.
Irgendeine Idee, was das sein könnte?
Mobile version