开发者

Random Data From Cassandra DB

开发者 https://www.devze.com 2023-02-23 07:25 出处:网络
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 acr

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

精彩评论

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