Questions tagged [cql3]

Cassandra Query Language (CQL) is a SQL (Structured Query Language)-like language for querying Cassandra.

Cassandra Query Language (CQL) is a SQL (Structured Query Language)-like language for querying Cassandra.

Although CQL has many similarities to SQL, there are some fundamental differences.

For example, the CQL adaptation to the Cassandra data model and architecture, doesn't support operations, such as JOINs, which make no sense in a non-relational database.

657 questions
7
votes
4 answers

How to switch Keyspace in Cassandra using CQL?

I used USE billKeyspace; to enter a keyspace and start using it. Now I want to exit this keyspace and enter another keyspace. How to do that? If I use exit; or quit; it exits out of cql session itself and then I have to connect again.
Pankaj
  • 474
  • 1
  • 3
  • 16
7
votes
1 answer

Cassandra order and clustering key

I have this table: CREATE TABLE custumer_events_service.events_by_websiteId_time( "event_id" text, "currentTime" timestamp, "websiteId" varchar, OTHER COLUMNS ... PRIMARY KEY(event_id, websiteId, currentTime) ) In this case,…
farhawa
  • 10,120
  • 16
  • 49
  • 91
7
votes
2 answers

CQL: Invalid set literal for values of type map

I have this table create table constants_values ( key_name_1 text, key_name_2 text, values map>, PRIMARY KEY(key_name_1, key_name_2) …
Manish Kumar
  • 10,214
  • 25
  • 77
  • 147
7
votes
4 answers

OperationTimedOut: errors={}, last_host=127.0.0.1

I am using a single node Cassandra and I intend to run some queries in order to check the response time. In some queries, after 10s of execution occurs to me the following error: OperationTimedOut: errors = {}, last_host = 127.0.0.1 So I ran the…
Pedro Cunha
  • 401
  • 1
  • 6
  • 16
7
votes
3 answers

CASSANDRA CQL3 : Set value to entire column

For my Cassandra Database, I need to set a value in column for all rows in my table. I see in SQL, we can do : UPDATE table SET column1= XXX; but in CQL (in cqlsh), It doesn't work ! I don't want to update row by row until 9500 rows. Do you have…
Quentin DESBOIS
  • 123
  • 1
  • 1
  • 9
7
votes
1 answer

Cassandra batch statement - Execution order

I have a batch statement of Cassandra that contains a delete and an insert statement of same partition key, where delete is the first statement and insert is the second. How the batch statement executes these statements ? Is in the same order in…
Jobs
  • 1,257
  • 2
  • 14
  • 27
7
votes
3 answers

Cassandra preventing duplicates

I have a simple table distributed by userId: create table test ( userId uuid, placeId uuid, visitTime timestamp, primary key(userId, placeId, visitTime) ) with clustering order by (placeId asc, visitTime desc); Each pair (userId, placeId)…
Sebastian Nowak
  • 5,607
  • 8
  • 67
  • 107
7
votes
2 answers

Cassandra TTL gets set to 0 on primary key if no TTL is specified on an update, but if it is, the TTL on the primary key does not change

This behavior in Cassandra seems counter-intuitive and I want to know why this is happening, and possibly work around this. Imagine I have a table with three columns: pk, the primary key, a text type, foo, a bigint, and bar, another text. insert…
2rs2ts
  • 10,662
  • 10
  • 51
  • 95
7
votes
1 answer

Unable to start cqlsh in Mac OS X?

I have installed cassandra 2.0 successfully. When I try to start cql 3 I get no such option: cassandra -v 2.0.9 ./cqlsh -3 Usage: cqlsh [options] [host [port]] cqlsh: error: no such option: -3
eagertoLearn
  • 9,772
  • 23
  • 80
  • 122
7
votes
1 answer

python cql driver - cassandra.ReadTimeout - "Operation timed out - received only 1 responses."

I am using Cassandra 2.0 with python CQL. I have created a column family as follows: CREATE KEYSPACE IF NOT EXISTS Identification WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'DC1' : 1 }; USE Identification; CREATE TABLE IF NOT…
mvallebr
  • 2,388
  • 21
  • 36
7
votes
3 answers

Cassandra CQL - clustering order with multiple clustering columns

I have a column family with primary key definition like this: ... PRIMARY KEY ((website_id, item_id), user_id, date) which will be queried using queries such as: SELECT * FROM myCF WHERE website_id = 30 AND item_id = 10 AND user_id = 0 AND date >…
kevad
  • 409
  • 1
  • 5
  • 15
7
votes
3 answers

Cassandra: How to insert a new wide row with good performance using CQL

I am evaluating cassandra. I am using the datastax driver and CQL. I would like to store some data with the following internal structure, where the names are different for each update. +-------+-------+-------+-------+-------+-------+ | |…
Rüdiger Klaehn
  • 12,445
  • 3
  • 41
  • 57
7
votes
1 answer

Query using composite keys, other than Row Key in Cassandra

I want to query data filtering by composite keys other than Row Key in CQL3. These are my queries: CREATE TABLE grades (id int, date timestamp, subject text, status text, PRIMARY KEY (id, subject, status, date) ); When I try and access the…
user988544
  • 556
  • 1
  • 11
  • 32
7
votes
5 answers

Creating column family or table in Cassandra while working Datastax API(which uses new Binary protocol)

I have started working with Cassandra database. I am planning to use Datastax API to upsert/read into/from cassandra database. I am totally new to this Datastax API (which uses new Binary protocol) and I am not able to find lot of documentations as…
arsenal
  • 23,366
  • 85
  • 225
  • 331
6
votes
1 answer

Can we use Cassandra as a Key-Value Store?

I have a simple question about using Cassandra as a key-value data store. I am stil new to Casandra concepts and I have searched for an answer for this question in several places but, I could not find a solid answer for this. Let's consider…
gbids
  • 489
  • 1
  • 6
  • 16