Questions tagged [cassandra]

1

votes
2

answer
2.5k

Views

Cassandra CodecNotFoundException: Codec not found for requested operation

I have an enum field that i want to map to a column in cassandra public enum MyEnum { Aa, Bb, Cc, } and here is how i registered it CodecRegistry myCodecRegistry = new CodecRegistry(); myCodecRegistry.register(new EnumOrdinalCodec(MyEnum.class)); cluster = Cluster.builder().addContactPoint(cassandra...
AbtPst
1

votes
2

answer
52

Views

Race conditions with Cassandra Counters

We have a Cassandra table where we are storing the number of sales of items in our Catalog. We are using counter data type for this purpose. We are still not sure if counter can handle race conditions. Multiple servers trying to increment the count for the same item. Do counters handle race condit...
Shashank Shekhar
1

votes
2

answer
79

Views

How to expose a headless service for a StatefulSet cassandra cluster externally in Kubernetes

I'm setting up multi node cassandra cluster in kubernetes (Azure AKS),Since this a headless service with statefull set pods without having a external IP. How can i connect my spark application with cassandra which is in kubernetes cluster We have tried with cluster ip,ingress ip also but only single...
suraj1287
1

votes
3

answer
41

Views

cassandra partition and clustering key

Is is possible to have a column as a partition and clustering key? For example, Create table citylist2 ( city varchar, loc list, pop int, zip varchar, state varchar, primary key (city,city,zip)) WITH CLUSTERING ORDER BY (city ASC, zip DESC); results in: InvalidRequest: Error from server:...
tom dinh
1

votes
1

answer
20

Views

How can I without the 'allow filtering' to have the conditional query in CQL?

I am the new leaner in CQL. I have the (restaurants) table. By implemented 'desc restaurants', it shows the information in restaurants table information How can I run the following query without using 'allow filtering', select name from restaurants where borough = 'brooklyn'; What are the necessary...
Hong
1

votes
2

answer
1.4k

Views

Save object in cassandra using spark and java

Just started working with spark and cassandra in Java and I am already stuck with saving data to my cassandra database. here is the java bean class that i have public class User implements Serializable { public User(){} public User(String username, String password){ this.username = username; setPass...
chris
1

votes
1

answer
46

Views

Cassandra constraints

We have a usecase of allowing only certain values in a cassandra column. Example: CREATED TABLE Cars( company text, model text, year int, vin text ) where a company may be from a spcific list of car makers e.g. GM, Toyota, Honda etc. Does cassandra support defining constraints for above use-case ? O...
Amit Kaneria
1

votes
1

answer
995

Views

How to insert Pandas DataFrame into Cassandra?

I have a dataframe as below: df date time open high low last 01-01-2017 11:00:00 37 45 36 42 01-01-2017 11:23:00 36 43 33 38 01-01-2017 12:00:00 45 55 35 43 .... I want to write it into cassandra. It's kind of bulk upload after processi...
AkshayNevrekar
1

votes
2

answer
28

Views

Is it possible to select X records from every clustering key Y in a partition?

Given a table with PRIMARY KEY (pkey, ckey_a, ckey_b, etc) WITH CLUSTERING ORDER BY (ckey_a, ckey_b, etc), is it possible to make a select statement to get the first 30 records of every ckey_b grouping from a specific primary key/wide row?
DJ_R
1

votes
3

answer
36

Views

Why we take snap shots in Cassandra?

Why we take snap shots in Cassandra ? see for example, the replication factor is 3 in a 4 node cluster, suppose 1 node goes down even though data is replicated remaining in 2 nodes right?
Rajesh Vakcharla
1

votes
2

answer
44

Views

How do you UPDATE a Cassandra column without directly knowing the primary key?

Given a scenario where you have a User table, with id as PRIMARY KEY. You have a column called email, and a column called name. You want to UPDATE User.name based on User.email I realized that the UPDATE command requires you to pass in a PRIMARY KEY. Does this mean I can't use a pure CQL migration,...
Ka Mok
1

votes
1

answer
29

Views

Scylla Upgrade issue from 2.1.x to 2.2.x

While I was upgrading my 3 node Scylla cluster found some mismatch. I have upgraded one node as procedure described in below link. https://docs.scylladb.com/upgrade/upgrade-opensource/upgrade-guide-from-2.1-to-2.2/ Once upgrade my one node I have check 'nodetool describedcluster' then found 'Schema...
LetsNoSQL
1

votes
0

answer
38

Views

Cassandra ExecutionResult on importlib._bootstrap failed

I am trying to execute multi-process to pull the data from Cassandra. But, I'm facing the issue.I want to pull it for single key or multiple keys using the multi-process provided my Cassandra My cassandra_db class from cassandra.cluster import Cluster import cassandra import pandas as pd import nump...
Anji
1

votes
0

answer
109

Views

While running Docker container with external Spark I am getting this error

My Spark is running on cluster mode. I assembly spark-cassandra-connector jar to my application jar then submitting the job from Docker. Still facing this issue. java.lang.ClassNotFoundException: com.datastax.spark.connector.rdd.partitioner.CassandraPartition at java.net.URLClassLoader.findClass(URL...
Chintamani
1

votes
0

answer
278

Views

Cannsandra Driver & jnr-Unixsocket - java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider

I am using cassandra and jnr-unix socket in my project and both uses jnr-ffi. Not getting any error in my local, but getting error in test env. The versions are, Cassandra version - 3.3.2 jnr-unixsocket - 0.12 Error happens on calling UnixSocketChannel.open() from my code. Code from the hierarchy,...
user1578872
1

votes
0

answer
386

Views

cassandra node not starting due to ERROR [main] 2018-01-09 04:08:58,733 CassandraDaemon.java:705 - Exception encountered during startup

Cassandra node is not starting and throws the below exception. org.apache.cassandra.exceptions.InvalidRequestException: Unknown type datakeyspace.identificationtype at org.apache.cassandra.cql3.CQL3Type$Raw$RawUT.prepare(CQL3Type.java:768) ~[cassandra-all-3.11.0.1900.jar:3.11.0.1900] at org.apache.c...
vlsomisetty
1

votes
0

answer
52

Views

Cassandra Data Model for apache access logs

In a POC, we are using cassandra for storing (among other things) Apache access logs (parsed) and use together with apache spark + zeppelin. We have managed to get things working BUT we are very uncertain about how to model the data correctly. Edit: Our queries will span over months and years rather...
jrask
1

votes
1

answer
662

Views

Exception in thread “main” com.datastax.driver.core.exceptions.ServerError: An unexpected error occurred server side on

While trying to fetch around 500000 records from cassandra using the paging support, I observe the following exception some times. Please note that its an intermittent exception and not seen every time I run my program. Cassandra version : 3.10 Datastax driver : 3.1.0 Statement statement = new Si...
A N
1

votes
0

answer
346

Views

JVM state determined to be unstable

Sorry for my unstructured post. I am doing it the first time here and I am not a developer. We would appreciate any help we could get!! Thank you in advance. We are handling customer support for a client who bought our product which uses Cassandra as a database. The customer has one Cassandra node...
MGold
1

votes
0

answer
112

Views

Restoring a snapshot containing expired data

I have a snapshot of a production system that I want to restore into a test system to recreate a problem, easy so far. One of the tables contains data with a TTL that has expired now because the snapshot is a few weeks old. The restore works fine using sstableloader, destination cluster has a differ...
Barry Evans
1

votes
1

answer
31

Views

Cassandra: data modelling groups

Im seeking advice how to design the following usecase: User can be part of an Unit. If he is part of an unit and creates a device it should be visible to all users of the unit. If he is not part of a unit only he should see his own devices. Im thinking about storing devices in 2 tables: a) device_by...
Alex Tbk
1

votes
0

answer
700

Views

How to create batches for batch processing in python?

I have a data stored in cassandra which I want to retrieve in python for batch processing. I want to create batches based on time column. Say I extracted the data from cassandra between 9:00:00 and 10:00:00. Now I wanted to create batches for per minute data. (Same timestamp can be in many rows). 1...
AkshayNevrekar
1

votes
1

answer
70

Views

Unable to see blob data in CQLSH

While querying the byte array column of a cassandra table, instead of displaying the byte representation, CQLSH trying to decode the value and giving below error: Failed to format value '\x8eV4\xfe}\xd9p5\xb3Q\xf8\x87\xc1v3\xe7x!\x00\xd5\xaa>' : 'ascii' codec can't decode byte 0x8e in position 0: o...
Chaitanya
1

votes
1

answer
34

Views

Cassandra sstableloader streaming relevant part to []

I have got problem with sstableloader. Command: ./sstableloader -d 192.168.56.101 /home/test/Desktop/apache-cassandra-2.2.4/data/data/TestKeyspace5/tab3 gave me: Streaming relevant part of /home/test/Desktop/apache-cassandra-2.2.4/data/data/TestKeyspace5/tab3/la-1-big-Data.db to [] Where the most...
przemyslaw.sagalo
1

votes
2

answer
1.2k

Views

Parallelism in reading Oracle data from using Spark 1.6.2 JDBC

We have around 40 million records for table. How to choose the values of lowerBound, upperBound, and numPartitions while reading data from Oracle using Spark 1.6.2. I have partition key. we have datastax cluster - 3 nodes - 18 cores each - 27 GB for each Thanks in advance.
Chandra
1

votes
1

answer
580

Views

Cassandra Read or Write latency JMX metric

We are attempting to use Prometheus to manage Cassandra cluster (v2.1.x) in my organization. I have a question related to Read or Write latency metrics. For a node level read or write latency, the metric that I am using is - org.apache.cassandra.metrics(OneMinuteRate) For a table level, I am using...
Firdousi Farozan
1

votes
0

answer
236

Views

Trying to load janusgraph with local backend cassandra and elastic search

I am using Spark to load Janusgraph with Cassandra backend and elastic search, both running locally. val conf = new BaseConfiguration() conf.setProperty('storage.backend', 'cassandrathrift') conf.setProperty('storage.hostname', '127.0.0.1') conf.setProperty('index.search.backend','elasticsearch') c...
J.Doe
1

votes
0

answer
45

Views

How to pass user defined variable as argument to function/aggregate in Cassandra 3.0

Table/Type Structure: Create type typ_pks_details( tpks_value Text, tpks_date Text, tpks_comp_flg Text ); Create Table pk_summary ( pks_nbr_key text, pks_type_value text, pks_type_character text, pks_details map, PRIMARY KEY (pks_nbr_key,pks_type_val) ); Function/Aggregate: Create FUNCTION sfunc_co...
lakksv
1

votes
0

answer
91

Views

Why does hinted handoff not work sometimes?

I was testing the effect of playing around with some of the parameters relevant to hinted handoff. I have 3 nodes in the datacenter with replication strategy as SimpleStrategy. I wrote 200k entries(12 MB) in 2 nodes while the 3rd node was down. After the write was successful, I brought up the 3rd no...
Vishal Sharma
1

votes
1

answer
519

Views

Cassandra - How to check table data is consistent at a given point in time?

How to find out when a Cassandra table becomes 'eventually consistent'? Is there a definitive way to determine this at a given point in time? Preferably programatically through the Datastax driver API? I checked out the responses to the following related questions but there does not seem to be anyth...
Sundar Venkataraman
1

votes
1

answer
150

Views

Cassandra C# driver: Linq table queries returning data from first keyspace after changing keyspace on session

I'm using CassandraCSharpDriver 3.4.0.1 My C# application needs to create new keyspaces and be able to switch between them on the fly. Everything works fine except for direct table Linq Where queries, ex.: _table.Where(...).Execute(), which always return data from first keyspace, even if I recreate...
Charles Piché
1

votes
0

answer
130

Views

Cassandra Python-Driver — ReadFailure Error

I'm experiencing a ReadFailure error when making a 'SELECT' query through the python-driver for Cassandra. My instance of Cassandra is a single local node. It was installed via a tar file, versus installing it as a service. I have a keyspace called 'Documents' and a table with two columns, name an...
Fraizier Reiland
1

votes
1

answer
321

Views

Connection error: TypeError('ref() does not take keyword arguments',)}) [duplicate]

This question already has an answer here: cqlsh connection error: 'ref() does not take keyword arguments' 5 answers I am using ubantu 16.04 and Cassandra while calling the 'cqlsh' command on the terminal it is giving me the error. Connection error: ('Unable to connect to any servers', {'127.0.0.1':...
akhil singhal
1

votes
0

answer
28

Views

In Cassandra: How to limit results of list-column in selects

In relational databases we make many-to-many relations by using junction tables, but on the Cassandra what is best practice for storing many-to-many relations in form that we can limit relation results of rows, suppose we have a 'Tweets' table and i want store 'Like' events of users, every like row...
Moh
1

votes
1

answer
44

Views

scala group by on a Cassandra table column of list type

I would like apply group by on top_places ( Which is list). tenant_id | device_id | top_places -----------+-----------+------------ T1 | D2 | ['F', 'D'] T1 | D3 | ['F', 'D'] T1 | D4 | ['G', 'D'] T1 | D5 | ['G', 'Q'] T1 | D6 | ['A', 'F'] This is the result i get whe...
Anees A
1

votes
1

answer
345

Views

Cassandra datastax consistency level issue

I am creating a cassandra session object for my application and creating few prepared statements for it. Setting different consistency levels on each prepared statement. statement1 = session.prepare('SELECT key FROM foo WHERE key = ?'); statement1.setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM);...
cbz81
1

votes
0

answer
74

Views

How to use PySpark to run SQL aggregations on Cassandra row values?

I am currently using issuing 1000s of queries in python to cassandra. The row values looks something like this {'company_id': 1234, 'locations': ['sf', 'sj'...], 'attributes':[{'action': 'page_visit', 'timestamp': 123, 'address': reddit.com/asdf}, {'action': 'email', 'timestamp': 125', 'subject':...
pmdaly
1

votes
2

answer
98

Views

Dockers Cassandra node showing UJ

1.I have successfully installed Cassandra in dockers and i am using Linux-Ubuntu Virtual Machine. 2.For the execution i have used two VM of Linux-Ubuntu machine and made one seed node and one other node to join the seed node. Now it is not still showing UJ and not yet showing UN. Can anyone please t...
user9371612
1

votes
0

answer
211

Views

Nodetool repair erroring on cassandra 3.9 cluster complaining of dead nodes

I have a cassandra 3.9 cluster. I initiated a repair from one of the nodes in the cluster. The repair went nowhere. I see the logs on that initiated node filled with errors like this. ERROR [GossipTasks:1] 2018-02-16 23:27:36,949 RepairSession.java:347 - [repair #cadf6f11-1342-11e8-8d73-6767c6890f70...
Varsha
1

votes
0

answer
1.8k

Views

Looking for a good Cassandra GUI Client Tool

Kindly suggest a good client GUI tool for Cassandra or Please Share the download link of the DataStax DevCenter old version (V1.6.0). Currently we are using cqlsh to connect Cassandra. I couldn't find a better GUI for Cassandra.
Sandeep

View additional questions