I've noticed that selecting by key in CQL always returns a record even if one doesn't actually exist:
cqlsh:pow_test> select * from people;
cqlsh:pow_test> select * from people where key = '12345';
KEY
-------
12345
cqlsh:pow_test> select count(*) from people;
count
-------
0
cqlsh:pow_test> select count(*) from people where key = '12345';
count
-------
1
cqlsh:pow_test>
As I am currently writing a semi-generic data access layer for DSE, this makes it very difficult to detect when a row really exists or not. I don't necessarily know what columns I should check for especially given that some of them may be null and that might be completely valid.
Was this done on purpose? Is there a way to detect via CQL whether or not a row actually exists? Ideally, will future versions of CQL only return a row if the key actually existed?
Thanks,
Jason
