cassandra 2.0.2 - insert 시 기존 데이터 update (append 되지 않음)
cassandra 2.0.1 에서 중복된 list 값을 insert시 replace가 안되고 append되는 이슈가 있었다.
그러나. cassandra 2.0.2에서는 insert시 append(add) 가 아닌 replace가 된다.
원래 스펙상 insert 는 replace이다.
http://cassandra.apache.org/doc/cql3/CQL.html#collections
Writing list
data is accomplished with a JSON-style syntax. To write a record using INSERT
, specify the entire list as a JSON array.
Note: An INSERT
will always replace the entire list
테스트
cqlsh> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
cqlsh> USE ks;
cqlsh:ks> CREATE TABLE test (k int PRIMARY KEY, l list<int>);
cqlsh:ks> INSERT INTO test (k, l) VALUES (0, [0, 1]);
cqlsh:ks> INSERT INTO test (k, l) VALUES (0, [3, 4]);
cqlsh:ks> SELECT * FROM test;
k | l
---+--------
0 | [3, 4]
(1 rows)