Questions tagged [datastax-python-driver]

DataStax Python Driver for Apache Cassandra

A modern, feature-rich and highly-tunable Python client library for Apache Cassandra (2.1+) using exclusively Cassandra's binary protocol and Cassandra Query Language v3.

The driver supports Python 2.7, 3.3, 3.4, 3.5, and 3.6.

If you require compatibility with DataStax Enterprise, use the DataStax Enterprise Python Driver.

53 questions
1
vote
0 answers

How do I insert pickle files to Cassandra using python?

I am trying to store n number of pickle files in cassandra using python. I didn't find much examples to store the files. Please provide example or documentation, what should be datatype for the field and the insert query.
1
vote
2 answers

Getting SyntaxException programmatically creating a table with the Cassandra Python driver

Error: cassandra.protocol.SyntaxException: \ Code: cluster =…
1
vote
2 answers

How to connect to Cassandra Database using Python code

I had followed the steps given in https://docs.datastax.com/en/developer/python-driver/3.25/getting_started/ to connect to cassandra database using python code, but still after running the code snippet I am getting NoHostAvailable: ('Unable to…
Dolly
  • 97
  • 3
  • 18
1
vote
2 answers

How do I get the size of a Cassandra table using the Python driver?

To archive this using Cassendra Shell : nodetool cfstats -- . Python Package - cassendra-driver Docs - cassendra
abhinit21
  • 330
  • 1
  • 4
  • 13
1
vote
0 answers

Cassandra Python Driver: CRC Mismatch

I'm using cassandra-driver (version 3.25.0) in Python 3.8.10 with a Cassandra 4 database. Sometimes when making requests to the database I get the following error. I've pasted the relevant parts to the stacktrace below. File "XXXXX.py", line 17,…
1
vote
1 answer

Parallel Cassandra requests using Python multiprocessing library errors on wait()

I written a piece of code that is multiprocessing. Connecting to cassandra where I am running 32 queries to fetch data. I have tried to parralelize the fetch using the multiprocessing library in python. The code looks like this. from…
1
vote
0 answers

How to improve too slow to connect to Cassandra cluster with datastax drivers?

I have set up a Cassandra (3.11.10) cluster with 3 nodes on 3 AWS EC2 instances with identical hardware configuration in the same internal network recently. Each of them sees each other. By logging into each of them, you can get access to the tables…
1
vote
1 answer

How do I configure and execute BatchStatement in Cassandra correctly?

In my Python (3.8) application, I make a request to the Cassandra database via DataStax Python Driver 3.24. I have several CQL operations that I am trying to execute with a single query via BatchStatement according to the official documentation.…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
1
vote
1 answer

Is it possible to get a callback from Cassandra after the INSERT operation that the record was created successfully?

I have encountered very strange behavior and am trying to understand in which cases this may occur. In my Python application, I access the Cassandra database via the driver. As you can see below, first, I do an INSERT operation, which creates a…
1
vote
0 answers

Cassandra COPY FROM query error, with a CSV file

The problem: I'm trying to get it so I can use Cassandra to work with Python properly. I've been using a toy dataset to practice uploading a csv file into Cassandra with no luck. Cassandra seems to work fine when I am not using COPY FROM for csv…
1
vote
1 answer

Cassandra warning about CQLENG_ALLOW_SCHEMA_MANAGEMENT

When I run my Python scripts that use Cassandra, I get the following warning: /home/ubuntu/.local/lib/python2.7/site-packages/cassandra/cqlengine/management.py:545: UserWarning: CQLENG_ALLOW_SCHEMA_MANAGEMENT environment variable is not set. Future…
Wassinger
  • 347
  • 2
  • 16
1
vote
0 answers

cassandra.cluster.NoHostAvailable unknown exception

Below is my python code I read the keys from a CSV file and delete them in the database.It's running fine for a while and throwing me this timeout error. I don't see any GC issue and health of the node is working fine. Traceback (most recent call…
1
vote
1 answer

How to dynamically define CQLEngine models?

I am using Datastax's Cassandra Python driver's Object Mapper for defining cassandra table columns. I am trying to define the models at run time (that's the requirement). The table and column names and column types are resolved at run time. I am…
hemant
  • 23
  • 7
1
vote
1 answer

Cassandra execute_async request lose data

I need to insert the huge amount of data by using Python DataStax driver for Cassandra. As a result I cannot use execute( ) request. execute_async( ) is much faster. But I faced the problem of losing data during calling execute_async( ). If I use…
Gabriel.vs
  • 46
  • 6
1
vote
1 answer

Python Cassandra Driver: encoding issue during insertion

I'm developing a simple python module that reads data from a tsv file and load them into a Cassandra keyspace table. I started by looking at the examples given by Datastax and everything seemed to be ok, so at that point I began to code. The program…