我有一个 Scylla 表格如下所示:
cqlsh:sampleks> describe table test;
CREATE TABLE test (
client_id int,
when timestamp,
process_ids list<int>,
md text,
PRIMARY KEY (client_id, when) ) WITH CLUSTERING ORDER BY (when DESC)
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'}
AND comment = ''
AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_size': '1', 'compaction_window_unit': 'DAYS'}
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 172800
AND max_index_interval = 1024
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';
我看到这是我们查询它的方式。我已经有很长时间没有使用cassandra了,所以这个PER PARTITION LIMIT
对我来说是新的事物(看起来是最近添加的)。可以有人用通俗易懂的语言解释一下这是做什么的,并且给一些例子吗?我在网络上找不到任何好的文档来轻松地解释它。
SELECT * FROM test WHERE client_id IN ? PER PARTITION LIMIT 1;
.perPartitionLimit()
是RDD选择一个分区中的1个唯一行的可行命令。 - ChiMo