I read that, is not possible to update records by clustered key.
create table timeseries (
type text,
event_time timestamp,
event blob,
PRIMARY KEY (event_type, event_time)
)
WITH CLUSTERING ORDER BY (event_time ASC);
but the event time should be updatable. How can I update time ? Must I delete old row and than insert new one ? Or cassandra provide som other solution.
答案 0 :(得分:0)
在Cassandra中,更新和插入是相同的(upserts)。因此,如果您“更新”event_time
,您将真正创建新行,因为此列是群集列。
解决方案取决于您的要求 - 您可能需要重新考虑数据模型以获得所需的功能。例如,您真的需要更新event_time
吗?
您能描述一下您要解决的任务吗?