You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Marcin Szymaniuk (JIRA)" <ji...@apache.org> on 2013/02/07 10:25:13 UTC
[jira] [Commented] (CASSANDRA-5141) Can not insert an empty map.
[ https://issues.apache.org/jira/browse/CASSANDRA-5141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13573335#comment-13573335 ]
Marcin Szymaniuk commented on CASSANDRA-5141:
---------------------------------------------
Its letting me execute the insert with empty mup but that doesnt really inserting the map. Example:
insert into users(id,surname,favs) values('key123','justAString',{});
select * from users where id='key123';
id | favs | surname
--------+------+-------------
key123 | null | justAString
The question is is this what you aggreed for? Its a bit misleading for me - inserting an empty map means that have some semantic but I loose it.
The MapOperation.doPut method doesnt seem to care about empty map at all - its just iterating through a map. If its empty it does nothing.
> Can not insert an empty map.
> -----------------------------
>
> Key: CASSANDRA-5141
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5141
> 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 Set.
> 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) given.
> 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: http://www.atlassian.com/software/jira