You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Jonathan Rudenberg <jo...@titanous.com> on 2012/10/01 01:27:22 UTC

Re: Collections in native protocol

I'm putting a collection onto the wire in an EXECUTE request with exactly the same bytes that were received and I get:

"Can't apply operation on column with org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type) type"

Here's the full trace log from cassandra:

DEBUG 19:24:15,414 Received: PREPARE INSERT INTO things (id, set_text) VALUES (?, ?);
TRACE 19:24:15,414 CQL QUERY: INSERT INTO things (id, set_text) VALUES (?, ?);
TRACE 19:24:15,415 Stored prepared statement #413587006 with 2 bind markers
DEBUG 19:24:15,415 Responding: RESULT PREPARED 413587006 [id(gocql_collections, things), org.apache.cassandra.db.marshal.TimeUUIDType][set_text(gocql_collections, things), org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type)]
DEBUG 19:24:15,416 Received: EXECUTE 413587006 with 2 values
TRACE 19:24:15,416 [1] 'java.nio.HeapByteBuffer[pos=18 lim=34 cap=53]'
TRACE 19:24:15,416 [2] 'java.nio.HeapByteBuffer[pos=38 lim=51 cap=53]'
DEBUG 19:24:15,417 Responding: ERROR INVALID: Can't apply operation on column with org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type) type.


The prepared statement is:

INSERT INTO things (id, set_text) VALUES (?, ?);

and the collection value ({'asdf', 'sdf'}) is encoded as:

00 02 00 04 61 73 64 66 00 03 73 64 66

which is byte-for-byte exactly the same as what I get from Cassandra off the wire when I do a query for the same data.

I already have the driver working with other queries/inserts with all types, so this is just a collection encoding problem.

Thanks,

Jonathan


On Sep 30, 2012, at 2:34 PM, Sylvain Lebresne <sy...@datastax.com> wrote:

> On Sun, Sep 30, 2012 at 6:02 PM, Jonathan Rudenberg
> <jo...@titanous.com> wrote:
>> I found CASSANDRA-4453, but this only seems to specify the response format.
> 
> It's the same format for EXECUTE.
> 
>> Any pointers would be appreciated.
> 
> I'm afraid there isn't much more than the source at this point but
> I'll try to add something about that in the protocol spec.
> 
> --
> Sylvain


Re: Collections in native protocol

Posted by Sylvain Lebresne <sy...@datastax.com>.
Sure.

On Mon, Oct 1, 2012 at 5:33 PM, Jonathan Rudenberg
<jo...@titanous.com> wrote:
> Thanks. Do you want me to open a JIRA ticket?
>
> On Oct 1, 2012, at 2:45 AM, Sylvain Lebresne <sy...@datastax.com> wrote:
>
>> Ok, I'll look what's wrong.
>>
>> --
>> Sylvain

Re: Collections in native protocol

Posted by Jonathan Rudenberg <jo...@titanous.com>.
Thanks. Do you want me to open a JIRA ticket?

On Oct 1, 2012, at 2:45 AM, Sylvain Lebresne <sy...@datastax.com> wrote:

> Ok, I'll look what's wrong.
> 
> --
> Sylvain

Re: Collections in native protocol

Posted by Sylvain Lebresne <sy...@datastax.com>.
Ok, I'll look what's wrong.

--
Sylvain

On Mon, Oct 1, 2012 at 1:27 AM, Jonathan Rudenberg
<jo...@titanous.com> wrote:
> I'm putting a collection onto the wire in an EXECUTE request with exactly the same bytes that were received and I get:
>
> "Can't apply operation on column with org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type) type"
>
> Here's the full trace log from cassandra:
>
> DEBUG 19:24:15,414 Received: PREPARE INSERT INTO things (id, set_text) VALUES (?, ?);
> TRACE 19:24:15,414 CQL QUERY: INSERT INTO things (id, set_text) VALUES (?, ?);
> TRACE 19:24:15,415 Stored prepared statement #413587006 with 2 bind markers
> DEBUG 19:24:15,415 Responding: RESULT PREPARED 413587006 [id(gocql_collections, things), org.apache.cassandra.db.marshal.TimeUUIDType][set_text(gocql_collections, things), org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type)]
> DEBUG 19:24:15,416 Received: EXECUTE 413587006 with 2 values
> TRACE 19:24:15,416 [1] 'java.nio.HeapByteBuffer[pos=18 lim=34 cap=53]'
> TRACE 19:24:15,416 [2] 'java.nio.HeapByteBuffer[pos=38 lim=51 cap=53]'
> DEBUG 19:24:15,417 Responding: ERROR INVALID: Can't apply operation on column with org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type) type.
>
>
> The prepared statement is:
>
> INSERT INTO things (id, set_text) VALUES (?, ?);
>
> and the collection value ({'asdf', 'sdf'}) is encoded as:
>
> 00 02 00 04 61 73 64 66 00 03 73 64 66
>
> which is byte-for-byte exactly the same as what I get from Cassandra off the wire when I do a query for the same data.
>
> I already have the driver working with other queries/inserts with all types, so this is just a collection encoding problem.
>
> Thanks,
>
> Jonathan
>
>
> On Sep 30, 2012, at 2:34 PM, Sylvain Lebresne <sy...@datastax.com> wrote:
>
>> On Sun, Sep 30, 2012 at 6:02 PM, Jonathan Rudenberg
>> <jo...@titanous.com> wrote:
>>> I found CASSANDRA-4453, but this only seems to specify the response format.
>>
>> It's the same format for EXECUTE.
>>
>>> Any pointers would be appreciated.
>>
>> I'm afraid there isn't much more than the source at this point but
>> I'll try to add something about that in the protocol spec.
>>
>> --
>> Sylvain
>