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

cqlsh TypeError('ref() does not take keyword arguments',)

When trying to cqlsh, following error is occuring: Connection error: ('Unable to connect to any servers', {'localhost': TypeError('ref() does not take keyword arguments',)})
sachinpkale
  • 989
  • 3
  • 14
  • 35
4
votes
2 answers

Cassandra CQL Shell stop displaying rows

I am wondering is there a command to stop displaying MORE rows from the CQL Shell. I created a table and inserted with 100k rows, so every time select * from test_table will display 100k rows, with MORE rows shown by pressing the Enter key. So I…
daiyue
  • 7,196
  • 25
  • 82
  • 149
4
votes
1 answer

cassandra copy makes empty string null on reimport

I use COPY command to take a copy of data. COPY looks more simple than sstables. But it looks like it can't import empty string. Columns which are empty in original table are null in imported. Steps to reproduce below. CREATE TABLE empty_example (id…
kharus
  • 41
  • 1
  • 3
4
votes
1 answer

Cassandra cql shell script

I'm having an issue with a simple script here. Just can't find documented help that resolves my issue. Here is my script. #!/bin/bash $VCOPS_BASE/cassandra/apache-cassandra-2.1.8/bin/cqlsh --ssl --cqlshrc $VCOPS_BASE/user/conf/cassandra/cqlshrc…
PA_Commons
  • 269
  • 2
  • 6
  • 14
4
votes
2 answers

How can I change the cqlsh (cqlsh_history) log file location?

cqlsh currently logs commands to ~/.cassandra/cqlsh_history It would be really convenient to change that to /var/log/cqlsh I'm guessing there's an optional cqlsh logging config file. I can't find it documented anywhere. Anyone know anything about…
jorfus
  • 2,804
  • 27
  • 23
4
votes
1 answer

insert nan's instead of a float in cassandra using python3

I want to insert nan instead of the float values using python code. Here is what I'm trying, and always end up with a typecast error: example input_map {1:0.9, 2:0.8, 3:NaN} for key in input_map: if (not…
PRM
  • 41
  • 3
4
votes
1 answer

Apache Cassandra 3.0.0 Materialized View: can the view's partition key change due to changes to the underlying table?

Just thinking about this so please correct my understanding if any of this isn't right. Environment: Apache Cassandra v3.0.0 Say you have a table and a materialized view created on it: create table source( id text, field text, stamp timestamp, data…
WillZ
  • 3,775
  • 5
  • 30
  • 38
4
votes
2 answers

Is Cassandra Update IF statement where the condition is an inequality expression supported?

Is UPDATE IF [condition] where [condition] is an inequality, supported by Cassandra CQL? I had a look over the language reference and it seems that CQL should not be able to support the inequality through its grammar. I used the language reference…
Dumb Questioner
  • 2,147
  • 4
  • 20
  • 21
4
votes
1 answer

Is there a way to get random rows each time if the data does not change in Cassandra like MySQL RAND()

CREATE TABLE users ( userId uuid, firstname varchar, mobileNo varchar, PRIMARY KEY (userId) ); CREATE TABLE users_by_firstname ( userId uuid, firstname varchar, mobileNo varchar, PRIMARY KEY (firstname,userId) ); I have 100 rows in these…
Chaity
  • 1,348
  • 13
  • 20
4
votes
2 answers

Column order when importing CSV into Cassandra with cqlsh

I'm new to Cassandra. CQL appears to ignore the column order in a CREATE TABLE statement, and order columns by primary key first and then by remaining columns in lexicographic order. I understand that's how they're stored internally, but coming…
Doctor J
  • 5,974
  • 5
  • 44
  • 40
4
votes
2 answers

Cassandra: Cannot truncate table

I have a table named buddyme.chatarch. When trying to truncate the table. cqlsh:buddyme> TRUNCATE chatarch; I am getting this error. TruncateError:
Vinod Patel
  • 430
  • 1
  • 7
  • 19
4
votes
2 answers

Apache Cassandra - cqlsh operation timeout

I am trying to start cqlsh and this is what I get: /bin$ ./cqlsh Connection error: ('Unable to connect to any servers', {'127.0.0.1': OperationTimedOut('errors=None, last_host=None',)}) I tried removing ~/.cassandra, did not work. I also…
Serban Stoenescu
  • 3,136
  • 3
  • 22
  • 41
4
votes
2 answers

Pickling Error running COPY command: CQLShell on Windows

We're running a copy command in CQLShell on Windows 7. At first, we ran into an "IMPROPER COPY COMMAND": COPY ourdata(data_time, data_ID, dataBlob) FROM 'TestData.csv' WITH HEADER = true; We later started receiving this error after running the…
Rdesmond
  • 1,201
  • 10
  • 30
4
votes
1 answer

update cassandra field using string concatenation

I am trying to update an existing string column in cassandra table. For example i want to append domain id in front of username. Following is my table id, username 1, agaikwad 2, xyz I want to write cql to update above table to reflect…
Abhijit Gaikwad
  • 3,072
  • 28
  • 37
4
votes
1 answer

Why doesn't Cassandra UPDATE violate the no read before writes rule

I am confused by two seemingly contradictory statements about Cassandra No reads before writes (presumably this is because writes are sequential whereas reads require scanning a primary key index) INSERT and UPDATE have identical semantics (stated…
John D.
  • 1,569
  • 2
  • 13
  • 11