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
70
votes
22 answers

Cassandra cqlsh - connection refused

I've just started working with Cassandra (datastax), version 2.1.3 and cqlsh version 5.0.1. Cassandra starts up fine and the cluster is operational instantly. Cqlsh is not working (on any of the nodes) and emits the following error: Connection…
Chros
  • 701
  • 1
  • 5
  • 4
62
votes
15 answers

Export cassandra query result to a csv file

I'm new in cassandra, and I have to export the result of a specific query to a csv file. I found the COPY command, but (from what I understand) it allows you only to copy an already existing table to a csv file, and what I want is to copy directly…
Dady09
  • 649
  • 2
  • 7
  • 10
50
votes
2 answers

Inserting a hard-coded UUID via CQLsh (Cassandra)

Would like to populate some static test data via a CQLsh script. This doesn't work: (device_id is UUID) insert into devices (device_id, geohash,name, external_identifier, measures, tags) values ('c37d661d-7e61-49ea-96a5-68c34e83db3a','9q9p3yyrn1',…
Chris H
  • 665
  • 1
  • 7
  • 10
47
votes
4 answers

Is there a clear equivalent of 'show keyspaces' in cqlsh 2?

What cqlsh command can I use to quickly see the keyspaces in a cluster? cqlsh does not provide show keyspaces and describe cluster isn't as concise as I want. I'm working using the following specifications: cqlsh 2.2.0, Cassandra 1.1.10, CQL spec…
Crowie
  • 3,220
  • 7
  • 28
  • 48
41
votes
1 answer

Getting Cassandra datacenter name in cqlsh

How can I get the name of the datacenter in cqlsh? It's required for the constructor of DCAwareRoundRobinPolicy.
palacsint
  • 28,416
  • 10
  • 82
  • 109
40
votes
5 answers

Import and export schema in cassandra

How to import and export schema from Cassandra or Cassandra cqlsh prompt?
vpggopal
  • 437
  • 1
  • 4
  • 3
35
votes
1 answer

Check CQL version with Cassandra and cqlsh?

How do you check which cql version is currently being used in cqlsh? In sql, you do this: Select @@version
AturSams
  • 7,568
  • 18
  • 64
  • 98
34
votes
5 answers

Executing CQL through Shell Script?

I am trying to execute the CQL commands from shell script. I am able to connect to the cqlsh (CQL version i'm using is 1.1.18) but unable to send the queries to cql. Any ideas or suggestion how to proceed on this? Do I need to connect to Cassandra…
Immadisetty
  • 341
  • 1
  • 3
  • 3
31
votes
18 answers

Cassandra cqlsh Unable to connect to any servers - 127.0.0.1:9160 (closed)> is already closed

I installed Cassandra on OSX. When trying to run cqlsh from /bin/, I get the following error: > Connection error: ('Unable to connect to any servers', {'127.0.0.1': > ConnectionShutdown('Connection 127.0.0.1:9160…
Peter Dietz
  • 2,599
  • 1
  • 24
  • 23
31
votes
2 answers

alter composite primary key in cassandra CQL 3.0

I'm in a situation where I need to change the the composite primary key as follows: Old Primary Key: (id, source, attribute_name, updated_at); New Primary Key I want: (source, id, attribute_name, updated_at); I issued the following (mysql like)…
aroyc
  • 890
  • 2
  • 13
  • 26
28
votes
4 answers

Cassandra timeout cqlsh query large(ish) amount of data

I'm doing a student project involving building and querying a Cassandra data cluster. When my cluster load was light ( around 30GB ) my queries ran without a problem, but now that it's quite a bit bigger (1/2TB) my queries are timing out. I thought…
slmyers
  • 767
  • 1
  • 8
  • 21
27
votes
6 answers

cqlsh connection error: 'ref() does not take keyword arguments'

I've tried all the measures from this post and Cassandra doc. I've tried running all the versions of Cassandra including the latest release 3.7 from tarball and Debian package, but I keep getting errors when I execute cqlsh. Error: Connection…
tet
  • 1,287
  • 1
  • 17
  • 36
27
votes
2 answers

cassandra primary key column cannot be restricted

I am using Cassandra for the first time in a web app and I got a query problem. Here is my tab : CREATE TABLE vote ( doodle_id uuid, user_id uuid, schedule_id uuid, vote int, PRIMARY KEY ((doodle_id), user_id,…
Orodan
  • 1,047
  • 2
  • 13
  • 24
26
votes
14 answers

How to connect Cassandra to localhost using cqlsh?

I set rpc_port to the public IP address, and now I can connect to Cassandra just fine from an outside server. However, I cannot connect from the Cassandra server itself, using cqlsh I am getting an error.Thar are: Connection error: Could not…
Albert Lim
  • 311
  • 1
  • 3
  • 8
24
votes
2 answers

Cassandra: Unable to coerce '2016-04-06 13:06:11.534000' to a formatted date (long)

I am trying to UPDATE an existing item in my cassandra DB using cqlsh: $ > UPDATE allEvents SET "isLastEvent" = True WHERE "websiteId" = 'sd-8231' AND "purchaser" = False AND "currentTime" = '2016-04-06 13:06:11.534000'; And I got…
farhawa
  • 10,120
  • 16
  • 49
  • 91
1
2 3
53 54