scylladb / scylla-rust-driver

Async CQL driver for Rust, optimized for ScyllaDB!
Apache License 2.0
543 stars 94 forks source link

CQL Vector type #1014

Open pkolaczk opened 2 weeks ago

pkolaczk commented 2 weeks ago

https://cassandra.apache.org/doc/latest/cassandra/reference/vector-data-type.html

I noticed that any attempt to perform a query on a table that contains a vector column fails, because the schema is rejected.

Any hints where I should modify the code to add support for this type?

mykaul commented 2 weeks ago

ScyllaDB doesn't yet support Vector types.

wprzytula commented 2 weeks ago

Reopening as support for CQL Vector is part of Cassandra compatibility, which we strive towards. Contributions are welcome that would add support for it.

wprzytula commented 2 weeks ago

Any hints where I should modify the code to add support for this type?

For adding CqlVector type, see frame/value.rs (e.g. similarly to CqlTime). Also, add a variant to CqlValue and implement FromCqlVal.

Then, the ser/de capabilities should be added by implementing {De,S}erializeValue in serialize/value.rs and deserialize/value.rs.

mykaul commented 2 weeks ago

Any hints where I should modify the code to add support for this type?

For adding CqlVector type, see frame/value.rs (e.g. similarly to CqlTime). Also, add a variant to CqlValue and implement FromCqlVal.

Then, the ser/de capabilities should be added by implementing {De,S}erializeValue in serialize/value.rs and deserialize/value.rs.

And relevant tests in the test suite against Cassandra in CI please.

pkolaczk commented 1 week ago

Oh, interesting, looks like we've been working on this in parallel https://github.com/scylladb/scylla-rust-driver/pull/1022

I still need to add tests, but overall this seems to be working in latte nicely. Serializing / deserializing vectors works.