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
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
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
1 answer

Cassandra cql select sorting

If I define a table like this using cql: CREATE TABLE scores ( name text, age int, score int, date timestamp, PRIMARY KEY (name, age, score) ); And do a SELECT in cqlsh like this: select * from mykeyspace.scores; The result displayed seems to…
ptmoy2
  • 311
  • 1
  • 4
  • 13
6
votes
4 answers

Cassandra 3.11.3 and cqlsh not support python 3.6 and 3.7?

I have installed Python 3.6 or 3.7 with Cassandra 3.11.3. But it does not supporte cqlsh, it only supports the Python 2.7 version. This is the error message: \apache-cassandra-3.11.3\bin\\cqlsh.py", line 146 except ImportError, e: …
6
votes
1 answer

Cassandra read error

tl;dr I solved the issue upgrading to Cassandra 3.2. This bug was apparently causing the problem. I'm running a two-node cluster of Cassandra with versions [cqlsh 5.0.1 | Cassandra 3.0.1 | CQL spec 3.3.1 | Native protocol v4]. There is one table…
Cedric H.
  • 7,980
  • 10
  • 55
  • 82
6
votes
2 answers

Get distinct partition keys from C* table

cqlsh doesn't allow nested queries so I cant export selected data to csv.. I'm trying to export the selected data (about 200,000 rows with a single column) from cassandra using: echo "SELECT distinct imei FROM listener.snapshots;" > select.cql…
user2552806
6
votes
2 answers

Cassandra can not delete role or user which in the role or user list

create ROLE testROLE with PASSWORD = 'test'; create ROLE testROLE with PASSWORD = 'test'; list ROLES shows the roles successfully. DROP ROLE testROLE; InvalidRequest: code=2200 [Invalid query] message="testrole doesn't exist" DROP ROLE…
Zhang LongQI
  • 494
  • 1
  • 11
  • 25
6
votes
2 answers

How to change PARTITION KEY column in Cassandra?

Suppose we have such table: create table users ( id text, roles set, PRIMARY KEY ((id)) ); I want all the values of this table to be stored on the same Cassandra node (OK, not really the same, same 3, but have all the data…
6
votes
2 answers

How to run Cassandra (cqlsh) from anywhere

In Cassandra the official documentation (https://wiki.apache.org/cassandra/GettingStarted) it states, to start the service use 'bin/cassandra -f' Then use 'bin/cqlsh' to access. But to use cqlsh in this way I always have to go to the bin folder.…
user4700203
6
votes
1 answer

how to load .tsv files into cassandra

I am trying to load .csv file into Cassandra with "|" as a delimiter but one of the record has got that & there is a record mismatch error. I have tried other delimiters but they are present in the records. When I use tab or special symbols as…
Pavan Chakravarthy
  • 573
  • 4
  • 7
  • 16
6
votes
1 answer

Astyanax Cassandra Double type precision

I'm trying to get a Double value from a Cassandra table with a double type column. I've created the table in CQL3 syntax: CREATE TABLE data_double ( datetime timestamp, value double, primary key (datetime) ); I've inserted a…
Guy Wald
  • 599
  • 1
  • 10
  • 25
6
votes
2 answers

Drop all keyspaces in cassandra

How to drop all keyspace in cassandra, I have requirement where I have to delete all keyspaces created by some test scripts. Thanks
Rahul Rohilla
  • 105
  • 1
  • 2
  • 8
5
votes
3 answers

Run cassandra cqlsh with python 3 on windows 10

I'm trying to run the cassandra cqlsh command using python 3 on windows 10. When I run the command I get this error: cqlsh File "C:\Program Files\apache-cassandra-3.11.6\bin\\cqlsh.py", line 248 CONFIG_FILE = os.path.join(HISTORY_DIR,…
bluethundr
  • 1,005
  • 17
  • 68
  • 141
5
votes
1 answer

What does "PER PARTITION LIMIT" means in cql query in cassandra?

I have a scylla table as shown below: cqlsh:sampleks> describe table test; CREATE TABLE test ( client_id int, when timestamp, process_ids list, md text, PRIMARY KEY (client_id, when) ) WITH CLUSTERING ORDER BY (when DESC) …
dragons
  • 549
  • 1
  • 8
  • 24
5
votes
2 answers

Which compaction strategy to use for both read/write intensive program using scylla db

I have a program intensively read and write (same amount of read and write, for write, 4/5 update and 1/5 insert). Is SizedTired compaction better than Leveled one? Also most of data have TTL 7 days and others are 1 day. In this case, is Time…
SilentCanon
  • 626
  • 4
  • 11