[
https://issues.apache.org/jira/browse/CASSANDRA-6599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14094157#comment-14094157
]
Sylvain Lebresne commented on CASSANDRA-6599:
---------------------------------------------
Looking closer, adding nulls to maps is a little more involved than it sound
and I'm not sure how eager I am with biting that bullet. First there is a
couple of methods in {{MapType}} and {{MapSerializers}} that would need to
handle null for values but that's not a big deal. But it's a bit annoying for
UDTs/tuples. Namely, keeping the nulls when the map is inside a UDT would be
kind of inconsistent behavior, but removing the null values would require
forcing a deserialization of every UDT value (potentially with nesting) just
for that. Given that, I'm actually starting to think that just suppporting the
{{...map - \{2, 3\}...}} syntax is just easier. As a side note, even if we were
to add syntax for nulls as map values, it won't make sense for lists, sets or
map keys, so there is an element of consistencies in keeping the "no nulls in
collection" rules.
> CQL updates should support "column = column - { key1, key2, ... }" syntax for
> removing map elements
> ---------------------------------------------------------------------------------------------------
>
> Key: CASSANDRA-6599
> URL: https://issues.apache.org/jira/browse/CASSANDRA-6599
> Project: Cassandra
> Issue Type: Wish
> Reporter: Gavin
> Assignee: Benjamin Lerer
> Priority: Minor
> Labels: cql
> Fix For: 2.1.1
>
> Attachments: 6599-proto.txt, CASSANDRA-6599.txt
>
>
> A variable number number of elements can be removed from lists and sets using
> an update statement of the form "update .... set column=column - {....} where
> ...". This syntax should also be supported for map columns. This would be
> especially useful for prepared statements (I know that you can use "set
> column[...] = null" to remove items in an update statement, but that only
> works for one element at a time).
--
This message was sent by Atlassian JIRA
(v6.2#6252)