【发布时间】:2017-05-04 08:41:24
【问题描述】:
我在 cassandra 中有一张表,其架构如下:
CREATE TABLE user_album_entity (
userId text,
albumId text,
updateDateTimestamp timestamp,
albumName text,
description text,
PRIMARY KEY ((userId), updateDateTimestamp)
);
获取数据所需的查询将有一个 where userId = xxx order by updateTimestamp。因此架构有 updateDateTimestamp。
问题在于更新表的列。查询是:更新user id = xxx的用户的专辑信息。但根据规范,对于更新查询,我需要 updateDateTimestamp 的确切值,在正常情况下,应用程序永远不会发送。
这些问题的答案应该是什么,因为我相信这是一个非常常见的用例,其中选择查询需要对时间戳进行排序。非常感谢任何帮助。
【问题讨论】:
标签: cassandra