scylladb / scylladb/cpp-rs-driver

Implement vector type support

Open
#415 2 comments 0 reactions 1 assignee View on GitHub

@wprzytula is already working on this.

Since Feb 26, 2026.

P1
Dominant language
C++
Stars
26
Forks
19
Avg merge
1d 21h
Merged PRs (30d)
7

Description

Summary

The cass_statement_bind_custom(), cass_statement_bind_custom_n(), cass_collection_append_custom(), and cass_collection_append_custom_n() functions are currently unimplemented (listed in api.rs:398,570). This prevents binding data to columns with CASS_VALUE_TYPE_CUSTOM type, which includes vector<float, N> columns.

Problem

CQL vector<float, N> columns are reported as CASS_VALUE_TYPE_CUSTOM by the driver. There is no C API path to bind data to these columns:

  • cass_statement_bind_bytes() creates CassCqlValue::Blob, but is_type_compatible() in value.rs:119-124 only allows Blob for CASS_VALUE_TYPE_BLOB and CASS_VALUE_TYPE_VARINT, rejecting CASS_VALUE_TYPE_CUSTOM
  • cass_statement_bind_custom() / cass_statement_bind_custom_n() are not implemented
  • No other bind function produces a value compatible with CUSTOM columns

The same issue applies to collection elements via cass_collection_append_custom() / cass_collection_append_custom_n(), which prevents binding list<vector<float, N>> columns.

Reproduction

// Prepare a statement for a table with a vector<float, 3> column
const CassPrepared* prepared = ...;
CassStatement* stmt = cass_prepared_bind(prepared);

// This silently fails with CASS_ERROR_LIB_INVALID_VALUE_TYPE
float data[] = {1.0f, 2.0f, 3.0f};
CassError rc = cass_statement_bind_bytes(stmt, idx, (const cass_byte_t*)data, sizeof(data));
// rc == CASS_ERROR_LIB_INVALID_VALUE_TYPE — value remains unset (NULL)

Expected behavior

The DataStax C++ driver provides cass_statement_bind_custom() which accepts a class name and raw bytes for CUSTOM type columns. The cpp-rs-driver should implement the same API to maintain compatibility and enable vector column support.

Affected functions

From api.rs:

  • cass_statement_bind_custom (line 398)
  • cass_statement_bind_custom_by_name (line 399)
  • cass_statement_bind_custom_n (line 400)
  • cass_collection_append_custom (line 570)
  • cass_collection_append_custom_n (line 571)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.