Cassandra secondary index issue - returning zero rows -
i have problem in secondary index returning 0 rows in cassandra:
i'm following along getting started docs:
http://www.datastax.com/documentation/getting_started/doc/getting_started/gettingstartedcql.html
based on have following cassandra script
/* hello.cql */ drop keyspace test; create keyspace test replication = { 'class' : 'simplestrategy', 'replication_factor' : 1 }; use test; create table users ( user_id int primary key, fname text, lname text); describe tables; insert users (user_id, fname, lname) values (1745, 'john', 'smith'); insert users (user_id, fname, lname) values (1744, 'john', 'doe'); insert users (user_id, fname, lname) values (1746, 'john', 'smith'); select * users; create index on users (lname); /* these queries both return 0 rows ??? */ select * users lname = 'smith'; select * users 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 straightforward -- missing something?
for 2 select
queries return results mean create index
execute synchronously and only return after existing data indexed.
if change order in script have index defined before insert data, i'd expect 2 selects return results.
Comments
Post a Comment