10
votes

I am using following version of cql and cassandra. See below: cqlsh 2.3.0 | Cassandra 1.1.10 | CQL spec 3.0.0 | Thrift protocol 19.33.0

I have all CF and tons of data in it. When I run:

cqlsh -2 or cqlsh -3 cql> USE "test_keyspace"; cql:test_keyspace> SELECT * FROM "column_family_name" LIMIT 1;

Note: CFs were created using pycassa and am trying to read using cql. Not sure, if this will make a difference.

It throws, Bad Request: unconfigured columnfamily Perhaps you meant to use CQL 2? Try using the -2 option when starting cqlsh.

Is there any specific settings, that I need to be looking at, to resolve this issue?

3

3 Answers

9
votes

by default CQL3 is case-insensitive unless enclosed in double quotation marks. Try putting your CFNAME in double quotes.

SELECT * FROM "CFNAME" LIMIT 1;

Looks like you have forgotten to enable CQL3 from api at the time of table creation

1
votes

I figured, one solution is using nodetool cfstats options and evaluate the result. This works for CFs which were never used at all but not work for CFs which were created and used for sometime, never cleaned up and abandoned later as their is no access time for CF in nodetool cfstats result.

0
votes

You are not specifying a keyspace in your statement.

Either specify the keyspace as follows:

 SELECT * FROM "keyspace_name"."column_family_name" LIMIT 1;

Or before querying the column family specify the keyspace to cqlsh via the 'using' statement:

using "keyspace_name"