Is there a possibility to retrieve random rows from Cassandra (using it with Python/Pycassa)?
Update: With random rows I mean randomly selected rows!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You might be able to do this by making a
get_rangerequest with a randomstartkey (just a random string), and arow_countof 1.From memory, I think the
finishkey would need to be the same asstart, so that the query ‘wraps around’ the keyspace; this would normally return all rows, but therow_countwill limit that.Haven’t tried it but this should ensure you get a single result without having to know exact row keys.