Is there a possibility to retrieve random rows from Cassandra (using it with Python/Pycassa)?
Update: With random rows I mean randomly selected rows!
You might be able to do this by making a get_range
request with a random start
key (just a random string), and a row_count
of 1.
From memory, I think the finish
key would need to be the same as start
, so that the query 'wraps around' the keyspace; this would normally return all rows, but the row_count
will limit that.
Haven't tried it but this should ensure you get a single result without having to know exact row keys.