Ryan Berryman created CASSANDRA-7035:
----------------------------------------

             Summary: Custom Types: failure to decode value when Custom Type is 
used as map key
                 Key: CASSANDRA-7035
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7035
             Project: Cassandra
          Issue Type: Bug
            Reporter: Ryan Berryman
            Priority: Blocker


Using 2.1 Beta through cqlsh:

{code} CREATE TYPE subject_id (
  ns        text,
  id        text
);

create table test (  id  int PRIMARY KEY, some_column map<subject_id, int>);
{code}

Both methods of inserting records appear to work and return with no error:

{code}
update test set some_column[{ns:'xyz.com', id:'userid'}] = 33 where id = 22222;

insert into test (id, some_column) values (444, {{ns:'abc.com', id:'user2'}: 
33});
{code}

retrieving the records fails

{code}
select * from test;
{code}

returns:

{code}
id    | some_column
-------+------------------------------------------------------------------------------
   444 |  
'\x00\x01\x00\x12\x00\x07abc.com\x00\x00\x05user2\x00\x00\x04\x00\x00\x00!'
 22222 | 
'\x00\x01\x00\x13\x00\x07xyz.com\x00\x00\x06userid\x00\x00\x04\x00\x00\x00!'

(2 rows)

Failed to decode value 
'\x00\x01\x00\x12\x00\x07abc.com\x00\x00\x05user2\x00\x00\x04\x00\x00\x00!' 
(for column 'some_column') as map<subject_id, int>: unhashable type: 'list'
Failed to decode value 
'\x00\x01\x00\x13\x00\x07xyz.com\x00\x00\x06userid\x00\x00\x04\x00\x00\x00!' 
(for column 'some_column') as map<subject_id, int>: unhashable type: 
'list'{code}




--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to