I have a problem in that a secondary index is returning zero rows in cassandra:
I'm following along the getting started docs:
http://www.datastax.com/documentation/getting_started/doc/getting_started/gettingStartedCQL.html
Based on that I have the following cassandra script
/* hello.cql */ drop keyspace test; CREATE KEYSPACE test WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; use test; CREATE TABLE users ( user_id int PRIMARY KEY, fname text, lname text); DESCRIBE TABLES; INSERT INTO users (user_id, fname, lname) VALUES (1745, 'john', 'smith'); INSERT INTO users (user_id, fname, lname) VALUES (1744, 'john', 'doe'); INSERT INTO users (user_id, fname, lname) VALUES (1746, 'john', 'smith'); SELECT * FROM users; CREATE INDEX ON users (lname); /* These queries both return 0 rows ??? */ SELECT * FROM users WHERE lname = 'smith'; SELECT * FROM users WHERE lname = 'doe';
However...
cqlsh < hello.cql users user_id | fname | lname ---------+-------+------- 1745 | john | smith 1744 | john | doe 1746 | john | smith (3 rows) (0 rows) (0 rows)
This should be straightforward -- am I missing something?