Sounds like https://issues.apache.org/jira/browse/CASSANDRA-6069

On Wed, Sep 25, 2013 at 8:29 PM, Joe Stein <crypt...@gmail.com> wrote:
> Hi, was not sure if there is a reason for this or I am doing something
> wrong or is known issue or not but when trying to insert a row with a map
> collection column and using if not exist the map is coming out as null :(
> see below, let me know, thanks!
>
> cqlsh:rvag> CREATE TABLE users (
>         ...     id text PRIMARY KEY,
>         ...     given text,
>         ...     surname text,
>         ...     favs map<text, text>   // A map of text keys, and text
> values
>         ... );
> cqlsh:rvag> INSERT INTO users (id, given, surname, favs)
>         ...            VALUES ('jsmith', 'John', 'Smith', { 'fruit' :
> 'apple', 'band' : 'Beatles' });
> cqlsh:rvag> select * from users;
>
>  id     | favs                                  | given | surname
> --------+---------------------------------------+-------+---------
>  jsmith | {'band': 'Beatles', 'fruit': 'apple'} |  John |   Smith
>
> (1 rows)
>
> cqlsh:rvag> truncate users;
> cqlsh:rvag> select * from users;
>
> (0 rows)
>
> cqlsh:rvag> INSERT INTO users (id, given, surname, favs)
>         ...            VALUES ('jsmith', 'John', 'Smith', { 'fruit' :
> 'apple', 'band' : 'Beatles' }) IF NOT EXISTS;
> cqlsh:rvag> select * from users;
>
>  id     | favs | given | surname
> --------+------+-------+---------
>  jsmith | null |  John |   Smith
>
> (1 rows)
>
> /*******************************************
>  Joe Stein
>  Founder, Principal Consultant
>  Big Data Open Source Security LLC
>  http://www.stealth.ly
>  Twitter: @allthingshadoop <http://www.twitter.com/allthingshadoop>
> ********************************************/



-- 
Yuki Morishita
 t:yukim (http://twitter.com/yukim)

Reply via email to