use*_*782 2 cassandra cassandra-3.0
我在Cassandra有桌子,我希望blob
从最后选择10usermgmt.user_history.history
CREATE TABLE usermgmt.user_history (
id uuid,
history Map<timeuuid, blob>,
PRIMARY KEY(id)
);
Run Code Online (Sandbox Code Playgroud)
我觉得5年的Cassandra设计很容易,有序的列型名称.但是现在我找不到在最近的Cassandra 3.0中选择10个最后条目范围的方法
这个怎么样:
CREATE TABLE usermgmt.user_history (
id uuid,
history_time timestamp,
history_blob blob,
PRIMARY KEY(id, history_time)
);
Run Code Online (Sandbox Code Playgroud)
然后,
SELECT * FROM usermgmt.user_history WHERE id = your-uuid ORDER BY history_time limit 10;
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
71 次 |
最近记录: |