0

I am trying the real time traffic sample in BAM, and find the message is stored into cassandra keyspace, with column family: bam_message_store.
However, with cql3, I can't browse the data, can you figure out why?

cqlsh:bam_util_ks> select * from bam_message_store;  
Bad Request: Keyspace bam_util_ks does not exist  
cqlsh:bam_util_ks> 
Community
  • 1
  • 1
wiwengweng
  • 352
  • 1
  • 4
  • 16

2 Answers2

2

Problem could be with the command you are using to connect to BAM_UTIL_KS keyspace. Keyspace name should be wrapped by quotations as follows. Following commands should work.

$ ./cqlsh localhost 9160 -u admin -p admin

Connected to Test Cluster at localhost:9160. [cqlsh 3.1.2 | Cassandra 1.2.10.1 | CQL spec 3.0.0 | Thrift protocol 19.36.0] Use HELP for help.

cqlsh> use "BAM_UTIL_KS";

cqlsh:BAM_UTIL_KS> select * from bam_message_store;

  • thanks, Inosh. This may not be the root cause for me, because I can see the command line "cqlsh:bam_util_ks" is already noted that the KS is found. I marked jayalalk as the answer, and his operation works for me. – wiwengweng Jan 22 '14 at 03:14
  • Yeah, jayalalk's answer is also should work. The problem happens because in CQL3, names are case insensitive by default, while they were case sensitive in CQL2. So you have to force whatever case you want in CQL3 by using double quotes(if you are the commands sequence I have used). http://inoshgoonewardena.blogspot.com/2014/01/connecting-to-cassandra-keyspaces.html – Inosh Goonewardena Jan 27 '14 at 08:53
1

Please try login with keyspace given as parameter in command line parameter, it works.

cqlsh -k BAM_UTIL_KS -u admin -p admin

cqlsh:BAM_UTIL_KS> describe tables;

bam_notification_messages 

cqlsh:BAM_UTIL_KS> select * from bam_notification_messages;
jayalalk
  • 2,382
  • 3
  • 17
  • 14