Apache Cassandra

Driver Version v0.1.0-alpha.1 Release Date 2026-08-24 Tested With Apache Cassandra 5.0 Tested With DataStax Enterprise 6.9

Warning

This is documentation for a prerelease version.

This driver provides access to Apache Cassandra , a distributed, open-source NoSQL database.

Installation

The Cassandra driver can be installed with dbc :

dbc install --pre cassandra

Connecting

To connect, provide a Cassandra connection string as the uri option:

from adbc_driver_manager import dbapi

conn = dbapi.connect(
    driver="cassandra",
    db_kwargs={
        "uri": "cassandra://localhost:9042/my_keyspace",
    },
)

The example uses Python and the adbc-driver-manager package, but the same options apply through other ADBC driver managers. See adbc-quickstarts for end-to-end examples.

Connection String Format

cassandra://[username[:password]@][host[:port]][/keyspace][?parameter1=value1&parameter2=value2...]

Components:

  • scheme: cassandra:// (required)

  • username: Username for authentication (optional)

  • password: Password for authentication (optional; requires a username)

  • host: Cassandra contact point (optional; defaults to 127.0.0.1)

  • port: Native transport port (optional; defaults to 9042)

  • keyspace: Initial keyspace (optional)

  • Query parameters: Connection options listed below

Examples:

  • cassandra://localhost:9042/my_keyspace

  • cassandra://user:password@cassandra.example.com/my_keyspace

  • cassandra://localhost/my_keyspace?page_size=1000&consistency=ONE&timeout=5000

  • cassandra:///my_keyspace?enable_tls=true&tls_ca_path=%2Fpath%2Fto%2Fca.pem

The URI accepts one contact point. To supply multiple contact points, use the cassandra.hosts option instead. Query parameter values must be URL-encoded when necessary. Unknown or repeated query parameters are rejected. Options specified separately from the URI take precedence over URI values.

Feature & Type Support

Feature Apache Cassandra DataStax Enterprise
Bind Parameters
Bulk Ingestion Create
Append
Create/Append
Replace
Temporary Table
Target Catalog
Target Schema
Non-nullable fields are marked NOT NULL
Catalog (GetObjects) depth=catalogs
depth=db_schemas
depth=tables
depth=columns (all)
Get Parameter Schema
Get Table Schema
Prepared Statements
Transactions

Types

Database to Arrow

Database Type Apache Cassandra DataStax Enterprise

BIGINT

int64

BOOLEAN

bool

DATE

date32[day]

DOUBLE PRECISION

double

INT

int32

LIST

list

MAP

map<string, int32> [1]

NUMERIC

decimal128

REAL

float

SET

list

SMALLINT

int16

TIME

time64[ns]

TIMESTAMP

timestamp[ms]

TIMESTAMP(p) (1 <= p <= 3)

timestamp[ms]

VARBINARY

binary

VARCHAR

string

Arrow to Database

Arrow Type Apache Cassandra Type DataStax Enterprise Type
Bind Ingest Bind Ingest

binary

BLOB

VARBINARY

BLOB

VARBINARY

binary_view

BLOB

VARBINARY

BLOB

VARBINARY

bool

BOOLEAN

date32[day]

DATE

decimal128

DECIMAL

NUMERIC

DECIMAL

NUMERIC

double

DOUBLE

DOUBLE PRECISION

DOUBLE

DOUBLE PRECISION

fixed_size_binary

BLOB

VARBINARY

BLOB

VARBINARY

float

FLOAT

REAL

FLOAT

REAL

halffloat

FLOAT

(NA/not tested)

FLOAT

(NA/not tested)

int16

SMALLINT

int32

INT

int64

BIGINT

large_binary

BLOB

VARBINARY

BLOB

VARBINARY

large_string

TEXT

VARCHAR

TEXT

VARCHAR

list

LIST, SET

LIST

LIST, SET

LIST

map<string, int32>

MAP [1]

string

TEXT

VARCHAR

TEXT

VARCHAR

string_view

TEXT

VARCHAR

TEXT

VARCHAR

time32[ms]

TIME

time32[s]

TIME

time64[ns]

TIME

time64[us]

TIME

timestamp[ms]

TIMESTAMP(3)

timestamp[ns]

TIMESTAMP(9)

timestamp[s]

TIMESTAMP(0)

timestamp[us]

TIMESTAMP(6)

Options

Connection Options

uri

Type: string. Default: not set.

Cassandra connection string in the format described above. If it is not set, the driver uses the defaults of 127.0.0.1 and port 9042.

username and password

Type: string. Default: not set.

Standard ADBC options for username/password authentication. The aliases cassandra.auth.username and cassandra.auth.password are also supported.

cassandra.hosts

Type: string. Default: 127.0.0.1.

Comma-separated list of Cassandra contact points. All contact points use the port set by cassandra.port.

cassandra.port

Type: integer. Default: 9042.

Native transport port used for all contact points.

cassandra.keyspace

Type: string. Default: not set.

Initial keyspace for the connection.

cassandra.num_conns (URI query parameter: num_conns)

Type: integer. Default: 2.

Number of connections to create per host.

cassandra.page_size (URI query parameter: page_size)

Type: integer. Default: 5000.

Maximum number of rows requested in each page of query results.

cassandra.consistency (URI query parameter: consistency)

Values: ANY, ONE, TWO, THREE, QUORUM, ALL, LOCAL_QUORUM, EACH_QUORUM, or LOCAL_ONE. Default: LOCAL_QUORUM.

Cassandra consistency level to use for queries. Values are case-insensitive.

cassandra.connect_timeout (URI query parameter: connect_timeout)

Type: integer. Default: 10000.

Connection timeout in milliseconds.

cassandra.timeout (URI query parameter: timeout)

Type: integer. Default: 10000.

Query timeout in milliseconds.

cassandra.protocol_version (URI query parameter: protocol_version)

Type: integer. Default: 4.

CQL native protocol version.

TLS Options

Boolean URI query parameters must be true or false.

cassandra.enable_tls (URI query parameter: enable_tls)

Type: boolean. Default: false.

Enable TLS for the connection.

cassandra.tls.ca_path (URI query parameter: tls_ca_path)

Type: string. Default: not set.

Path to a PEM-encoded CA certificate used to verify the server certificate.

cassandra.tls.cert_path and cassandra.tls.key_path (URI query parameters: tls_cert_path and tls_key_path) : Type: string. Default: not set.

Paths to a PEM-encoded client certificate and private key. Set both options to configure mutual TLS.

cassandra.tls.hostname_override (URI query parameter: tls_hostname_override) : Type: string. Default: not set.

Server name used for certificate verification.

cassandra.tls.skip_verify (URI query parameter: tls_skip_verify)

Type: boolean. Default: false.

Disable server certificate verification. This is not recommended for production use.

Compatibility

This driver was tested on:

  • Cassandra 5.0.9

  • DataStax Enterprise 4.0.0.6925