Here is the version of the cqlsh and Cassandra I am using:
yzhang@yzhangmac1:~/dse/bin$ ./cqlsh hostname 9160 -u username -p 
passwordConnected to P2 QA Cluster at c1-cass01.roving.com:9160.[cqlsh 3.1.2 | 
Cassandra 1.2.18.1 | CQL spec 3.0.0 | Thrift protocol 19.36.2]Use HELP for 
help.cqlsh> use mykeyspace;cqlsh: mykeyspace >
cqlsh:automation_d1> describe table "myTable";
CREATE TABLE "myTable" (  key varint,  key2 varint,  column1 bigint,  column2 
ascii,  value text,  PRIMARY KEY ((key, key2), column1, column2)) WITH COMPACT 
STORAGE AND  bloom_filter_fp_chance=0.010000 AND  caching='KEYS_ONLY' AND  
comment='' AND  dclocal_read_repair_chance=0.000000 AND  
gc_grace_seconds=864000 AND  read_repair_chance=0.100000 AND  
replicate_on_write='true' AND  compaction={'class': 
'SizeTieredCompactionStrategy'} AND  compression={'sstable_compression': 
'SnappyCompressor'};
select * from "myTable";   59 |  336 | 1100390163336 | A |   
[{"updated_at":1424844362530,"ids":"668e5520-bb71-11e4-aecd-00163e56be7c"}]  59 
|  336 | 1100390163336 | D |   
[{"updated_at":1424844365062,"ids":"668e5520-bb71-11e4-aecd-00163e56be7c"}]
Obviously, the table has lots of data. Now the problem is I cannot get any data 
back in my query using key of existing data. Why?
cqlsh:mykeyspace> select * from "myTable" where key=59 and 
key2=336;cqlsh:mykeyspace> select * from "myTable" where "key"=59 and 
"key2"=336;
As you can see, I know key=59 and key2=336 existed, but no matter what I try, I 
cannot query them out. The last 2 query didn't return the any result to me.
Now I tried the cassandra-cli:
./cassandra-cli -h hostname -u username -pw password[user1@unknown] use 
mykeyspace;Authenticated to keyspace: mykeyspace[user1@unknown] list 
myTable......................... lots of 
data............-------------------RowKey: 51:855=> (name=1100393052855:D, 
value=[{"updated_at":1424269592866,"id":"fc31b6d0-5479-11e4-8a79-00163e56be7c"}],
 timestamp=1424269592866000, ttl=2764800)-------------------RowKey: 59:336=> 
(name=1100390163336:A, 
value=[{"updated_at":1424844362530,"id":"668e5520-bb71-11e4-aecd-00163e56be7c"}],
 timestamp=1424844362533000, ttl=2764800)=> (name=1100390163336:D, 
value=[{"updated_at":1424844365062,"id":"668e5520-bb71-11e4-aecd-00163e56be7c"}],
 timestamp=1424844365063000, ttl=2764800)
[default@mykeyspace] get myTable['59:336'];Returned 0 results.Elapsed time: 62 
msec(s).
Why I cannot get the data by key, in neither cqlsh nor cassandra-cli?
Thanks
Yong
                                          

Reply via email to