Questions tagged [cqlsh]

cqlsh is a python-based command line client for executing Cassandra Query Language (CQL)

cqlsh is 'a python-based command line client for executing Cassandra Query Language (CQL) commands'1. It provides a quick and easy way to run simple CQL commands interactively. It has been available in the DataStax Community version of Cassandra since version 1.0.1.

The reference manual associated with CQL specification is here. Instructions for using cqlsh with Cassandra 1.0 can be found here.

803 questions
24
votes
4 answers

How to list column families in keyspace?

How can I get list of all column families in keyspace in Cassandra using CQL 3?
newbie
  • 24,286
  • 80
  • 201
  • 301
23
votes
2 answers

Creating new table with cqlsh on existing keyspace: Column family ID mismatch

Houston, we have a problem. Trying to create a new table with cqlsh on an existing Cassandra (v2.1.3) keyspace results in: ServerError:
maasg
  • 37,100
  • 11
  • 88
  • 115
23
votes
4 answers

How do you create the first user in Cassandra DB

How does one create the first user in a cassandra database? I tried: CREATE USER username WITH PASSWORD ""; and its says: Bad Request: Only superusers are allowed to perform CREATE USER queries But I have never created a user before this attempt,…
Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
22
votes
3 answers

How to copy data from a Cassandra table to another structure for better performance

In several places it's advised to design our Cassandra tables according to the queries we are going to perform on them. In this article by DataScale they state this: The truth is that having many similar tables with similar data is a good thing in…
astrojuanlu
  • 6,744
  • 8
  • 45
  • 105
22
votes
3 answers

Init script for Cassandra with docker-compose

I would like to create keyspaces and column-families at the start of my Cassandra container. I tried the following in a docker-compose.yml file: # shortened for clarity cassandra: hostname: my-cassandra image: my/cassandra:latest …
blakelead
  • 1,780
  • 2
  • 17
  • 28
22
votes
5 answers

Cassandra cqlsh - how to show microseconds/milliseconds for timestamp columns?

I'm inserting into a Cassandra table with timestamp columns. The data I have comes with microsecond precision, so the time data string looks like this: 2015-02-16T18:00:03.234+00:00 However, in cqlsh when I run a select query the microsecond data is…
WillZ
  • 3,775
  • 5
  • 30
  • 38
19
votes
5 answers

Cassandra CQLSH OperationTimedOut error=Client request timeout. See Session.execute[_async](timeout)

I want to transfer data from one Cassandra cluster (reached via 192.168.0.200) to another Cassandra cluster (reached via 127.0.0.1). The data is 523 rows but each row is about 1 MB. I am using the COPY FROM and COPY TO command. I get the following…
Rishabh Poddar
  • 919
  • 3
  • 9
  • 17
19
votes
4 answers

How to select data from a table and insert into another table?

I want to select specific fields of a table in cassandra and insert them into another table. I do this in sql server like this: INSERT INTO Users(name,family) SELECT name,family FROM Users How to to this in cassandra-cli or cqlsh?
ehsan shirzadi
  • 4,709
  • 16
  • 69
  • 112
18
votes
1 answer

cannot connect to cassandra docker with cqlsh

I'm run Cassandra docker container: docker pull cassandra run --name cassandra -p 9042:9042 -p 9160:9160 -d cassandra The netstat -tpln is: Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name LISTEN - tcp6 0 …
Alexandre Kalendarev
  • 681
  • 2
  • 10
  • 24
18
votes
2 answers

Prettifying results of cqlsh commands in Linux terminal

Is there any way to prettify the results of cql commands in the Linux terminal while using the cqlsh utility (cql version of Mongo .pretty())? It becomes quite difficult to read the results when the output is displayed normally, especially when…
booleanhunter
  • 5,780
  • 4
  • 16
  • 21
18
votes
8 answers

Can't connect to cassandra node from different host

I have a cassandra node at a machine. When I access cqlsh from the same machne it works properly. But when I tried to connect to it's cqlsh using "192.x.x.x" from another machine, I'm getting an error saying Connection error: ('Unable to connect to…
Chamila Wijayarathna
  • 1,815
  • 5
  • 30
  • 54
16
votes
2 answers

Cassandra data model for simple messaging app

I am trying to learn Cassandra and always find the best way is to start with creating a very simple and small application. Hence I am creating a basic messaging application which will use Cassandra as the back-end. I would like to do the…
user2924127
  • 6,034
  • 16
  • 78
  • 136
16
votes
2 answers

cassandra, select via a non primary key

I'm new with cassandra and I met a problem. I created a keyspace demodb and a table users. This table got 3 columns: id (int and primary key), firstname (varchar), name (varchar). this request send me the good result: SELECT * FROM demodb.users…
mel
  • 2,730
  • 8
  • 35
  • 70
16
votes
1 answer

Cassandra UPDATE primary key value

I understand that this is not possible using an UPDATE. What I would like to do instead, is migrate all rows with say PK=0 to new rows where PK=1. Are there any simple ways of achieving this?
greenimpala
  • 3,777
  • 3
  • 31
  • 39
16
votes
3 answers

Cassandra CQLSH TEXT field limit on COPY FROM CSV (field larger than field limit (131072))

When importing a record with a large field inside (longer than 124214 characters) I am getting the error "field larger than field limit (131072)" I saw form other posts how to solve this on Python but I don't know if it is possible on…
Vercintegorix
  • 305
  • 2
  • 6
1
2
3
53 54