开发者

Random Data From Cassandra DB

I'm using the Random Partitioner, and I'm wondering if there's a way to do the equivalent of a range scan to get a batch of random rows. I assume that the rows are rather randomly placed on disk across the cluster?

In other words, given a row 开发者_如何学Ckey in a random partition, is there a way to get X number of neighbors to that row as a random sample of data?


You may be able to do this by requesting an open-ended slice with a limit.

Using cassandra-cli, with a columnFamily of 'Test', you can do commands such as:

list Test['key':] limit 10;

Note that ['key':] and [:'key'] return the same results.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜