cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-5141) Can not insert an empty map.
Date Thu, 07 Feb 2013 09:47:13 GMT


Sylvain Lebresne commented on CASSANDRA-5141:

In Cassandra, an empty map/set/list is equivalent to the column being null. In other words
a collection only exists if it has elements. The reason for that semantic (versus having null
being different from empty) is honestly mainly dictated by implementation concerns (internally
a collection *does not* indeed exist unless it has elements). I.e. it's not because we think
it is intrinsically better that way, but it is also true that, at least as far as I'm concern,
I don't think it is intrinsically worst that way either.
> Can not insert an empty map. 
> -----------------------------
>                 Key: CASSANDRA-5141
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>            Reporter: Krzysztof Cieslinski Cognitum
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 1.2.1
>         Attachments: 5141.txt
> It is not possible to insert an empty map. It looks like the "{}" is reserved only for
> So when for table:
> {code}
> CREATE TABLE users (
>     id text PRIMARY KEY,
>     surname text,
>     favs map<text, text>
> )
> {code}
> I try to insert map without any elements:
> {code}
> cqlsh:test> insert into users(id,surname,favs) values('aaa','aaa',{});
> {code}
> I get:
> {code}
>  Bad Request: Set operations are only supported on Set typed columns, but org.apache.cassandra.db.marshal.MapType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.UTF8Type)
> text could not be lexed at line 1, char 63
> {code}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message