Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra cqlsh report Bad request for Using Consistency

Tags:

cassandra

cql

Datastax manual say that I can change consistency level with "USING CONSISTENCY" syntax. http://www.datastax.com/docs/1.1/references/cql/cql_data_types#specifying-consistency-level

But, Cassandra cqlsh report Bad request for Using Consistency.

cqlsh:db_simple> show version
[cqlsh 2.3.0 | Cassandra 1.2.3 | CQL spec 3.0.0 | Thrift protocol 19.35.0]

cqlsh:db_simple> SELECT * FROM test WHERE a=1;

 a | b  
---+---------
 1 | example

cqlsh:db_simple> SELECT * FROM test USING CONSISTENCY ONE WHERE a=1;
Bad Request: line 1:19 missing EOF at 'USING'

What do I miss ? Thanks.

like image 718
user2388689 Avatar asked May 16 '13 06:05

user2388689


1 Answers

The WITH CONSISTENCY LEVEL clause has been removed from CQL commands in 1.2. Programmatically, you now set the consistency level in the driver. On the command line, you can use a new cqlsh CONSISTENCY command.

In your case you have set like

cqlsh:keyspace> CONSISTENCY ONE;
Consistency level set to ONE.
like image 73
abhi Avatar answered Sep 22 '22 02:09

abhi