【发布时间】:2018-07-17 16:29:03
【问题描述】:
如何将新元素附加到 Cassandra 中自定义类型的集合中。
custom_type 是:
CREATE TYPE custom_type (
normal_type TEXT,
set_type Set<TEXT>
);
要更新的表格是:
CREATE TABLE test_table (
id TEXT,
my_type FROZEN<custom_type>,
clustering_key TEXT,
PRIMARY KEY ((id),clustering_key)
);
试过下面的查询,但没有用。
@Query("update test_table set my_type.set_type = my_type.set_type + {'newelement'} where id=?1 and clustering_key=?2")
关于如何做到这一点的任何想法?
使用[cqlsh 5.0.1 | Cassandra 3.11.1 | CQL spec 3.4.4
【问题讨论】: