Details
-
Bug
-
Status: Open
-
Normal
-
Resolution: Unresolved
-
None
-
None
-
Normal
Description
List of UDT can't be updated properly when using USING TIMESTAMP
Observe:
cqlsh:t360> CREATE TYPE fullname ( ... fname text, ... lname text ... ); cqlsh:t360> CREATE TABLE users ( ... id text PRIMARY KEY, ... names list<frozen <fullname>>, ... phone text ... ); cqlsh:t360> UPDATE users USING TIMESTAMP 1458019725701 SET names = [{ fname: 'fname1', lname: 'lname1'},{ fname: 'fname2', lname: 'lname2'},{ fname: 'fname3', lname: 'lname3'}] WHERE id='a'; cqlsh:t360> select * from users; id | names | phone ----+--------------------------------------------------------------------------------------------------------------+------- a | [{lname: 'lname1', fname: 'fname1'}, {lname: 'lname2', fname: 'fname2'}, {lname: 'lname3', fname: 'fname3'}] | null (1 rows) cqlsh:t360> UPDATE users USING TIMESTAMP 1458019725701 SET names = [{ fname: 'fname1', lname: 'lname1'},{ fname: 'fname2', lname: 'lname2'},{ fname: 'fname3', lname: 'lname3'}] WHERE id='a'; cqlsh:t360> select * from users; id | names | phone ----+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------- a | [{lname: 'lname1', fname: 'fname1'}, {lname: 'lname2', fname: 'fname2'}, {lname: 'lname3', fname: 'fname3'}, {lname: 'lname1', fname: 'fname1'}, {lname: 'lname2', fname: 'fname2'}, {lname: 'lname3', fname: 'fname3'}] | null (1 rows)
=> the list doesn't get replaced, it gets appended, which is not the expected/desired result