我在Cassandra有桌子,我希望从blob
usermgmt.user_history.history
CREATE TABLE usermgmt.user_history (
id uuid,
history Map<timeuuid, blob>,
PRIMARY KEY(id)
);
我觉得5岁的Cassandra设计很容易,有序的列名。但是现在我找不到在最近的Cassandra 3.0中选择10个最后条目范围的方法
答案 0 :(得分:5)
这个怎么样:
CREATE TABLE usermgmt.user_history (
id uuid,
history_time timestamp,
history_blob blob,
PRIMARY KEY(id, history_time)
);
然后,
SELECT * FROM usermgmt.user_history WHERE id = your-uuid ORDER BY history_time limit 10;