I'm trying to find a way to log all queries done on a Cassandra from a python code. Specifically logging as they're done executing using a BatchStatement
Are there any hooks or callbacks I can use to log this?
I'm sending data back and forth Python and Cassandra. I'm using both builtin float types in my python program and the data type for my Cassandra table. If I send a number 955.99 from python to Cassandra, in the database it shows 955.989999. When I…
I'm trying to load and delete data from Cassandra using the python driver. I have tried this both using cassandra running in a docker container and again locally after the docker version was giving me problems. Here's an example of what I'm…
I'm running Scylladb locally in a docker container and I want to access the cluster outside the docker container. That's when I'm getting the following error: cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers')
Datacenter:…
I try to insert 150.000 generated data to the Cassandra using BATCH in Python driver. And it take approximately 30 seconds. What should I do to optimize it and insert data faster ?
Here is my code:
from cassandra.cluster import Cluster
from faker…
I want to use ORM from DataStax Python Driver for Cassandra DB (create some class with data and automatically create a table from it without writing too much CQL = )
I've deployed a Cassandra server on localhost via docker and tried to do just like…
I want to execute multiple cql statements (2 or much more) using python driver.
I try such simple code but it lead to error if query contains more then one statement. I do not want to split statements or format it (to single statements). I just want…
I've just created two Cassandra clusters through Docker. The docker exec -it name nodetool status command tells that clusters created everything is ok:
Then I'll try to INSERT data to table from the Python driver.
Here is my code:
from…
I am trying to connect to cluster nodes having different ports (9042 and 9043), but cannot find ways to do it here:
cluster = Cluster(['0.0.0.0','0.0.0.0'],port=9042)
How do I do it?
I have an instance method that is used to construct a Cassandra query, and I'm looking for a way to more safely parametrize the table name in a query without using string formatting.
For example,
def some_method(self, table_name):
statement =…
I'm trying to declare and create (using sync_table) Cassandra table using a Object Mapper from python Cassandra driver (cassandra-driver package version 3.14), but I can't find a way to define a frozen value in a collection.
Is there a way to…
From the documentation , there is a way to insert data into table:
session.execute(
"""
INSERT INTO users (name, credits, user_id)
VALUES (%s, %s, %s)
""",
("John O'Reilly", 42, uuid.uuid1())
)
The column name have to be stated…
I am using cassandra python driver.
Version details :
[cassandra-driver (3.25.0)]
[cqlsh 6.8.0 | Cassandra 4.0.4 | CQL spec 3.4.5 | Native protocol v4]
I am querying Cassandra database where I have created few columns which have empty space and…
I'm using cassandradb with the datastax python driver on a linux system. Typically when using other databases, I've found that that on unix-compatible systems there's usually a way to establish a connection to the database via a unix socket, instead…
I'm writing 2.5 million records into Cassandra using a python program. The program finishes quickly but on querying the data, the records are reflected after a long time. The number of records gradually increase and it seems like the database is…