Cassarrow
Arrow based Cassandra python driver.
TLDR;
Speed up the cassandra python driver using C++ to parse cassandra queries data as Apache Arrow tables.
Key features:
- 20x speed up in the parsing of results
- 14x less memory
- Support for most native types, UDT, List and Set
Getting Started
Installation
pip install cassarrow
Usage
import cassarrow
import pyarrow as pa
# ...
with cassarrow.install_cassarrow(session) as cassarrow_session:
table: pa.Table = cassarrow.result_set_to_table(cassarrow_session.execute("SELECT * FROM my_table"))
Type Mapping
Native Types
| Cassandra | pyarrow | Note |
|---|---|---|
| ascii | pa.string() |
|
| bigint | pa.int64() |
|
| blob | pa.binary() |
|
| boolean | pa.bool_() |
|
| counter | TODO | |
| date | pa.date32() |
|
| decimal | Incompatible | |
| double | pa.float64() |
|
| duration | pa.duration("ns") |
|
| float | pa.float32() |
|
| inet | TODO | |
| int | pa.int32() |
|
| smallint | pa.int16() |
|
| text | pa.string() |
|
| time | pa.time64("ns") |
|
| timestamp | pa.timestamp("ms") |
|
| timeuuid | pa.binary(16) |
|
| tinyint | pa.int8() |
|
| uuid | pa.binary(16) |
|
| varchar | pa.string() |
|
| varint | Incompatible |
Collections / UDT
| Cassandra | pyarrow | Note |
|---|---|---|
| list | pa.list_ |
|
| map | pa.map_ |
|
| set | pa.list_ |
|
| udt | pa.struct |
Metadata
Release files for cassarrow 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cassarrow-0.1.2.tar.gz | 12.9 kB | Without provenance | Details for cassarrow-0.1.2.tar.gz |
Release files / cassarrow-0.1.2.tar.gz
| Download URL | cassarrow-0.1.2.tar.gz |
|---|---|
| Size | 12.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bf61c07c3e2ee63cf14139a8037ce751fe9162620c956fd847255011fa4a6c9
|
|
BLAKE2b-256 checksum How to use checksums |
8f83b6de552803248586b7196fd0ab07e5655d0c63a987fdf1d2b07a86c3c752
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Security for cassarrow 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.