cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-8813) MapType.compose throws java.lang.IllegalArgumentException: null when either of the key or value pair in map type object is of type int (Int32Type)
Date Tue, 17 Feb 2015 09:02:12 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-8813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14323958#comment-14323958
] 

Sylvain Lebresne commented on CASSANDRA-8813:
---------------------------------------------

I'm not really sure what "cqlclient" is, but you're not really supposed to use {{MapType.compose}}
in client codes. But yes, that method does assume the protocol v3 encoding if that's what
you mean. It's not a bug, it's what make sense for the code server side since {{compose()}}
is only used with frozen maps which does always use the v3 encoding. If you want to deserialize
a map value for a specific protocol version, you should look at {{MapSerializer.deserializeForNativeProtocol}}.
Or really, don't use server side classes. The [DataStax Java Driver|https://github.com/datastax/java-driver]
has everything you need to [deserialize values|http://www.datastax.com/drivers/java/2.1/com/datastax/driver/core/DataType.html#deserialize(java.nio.ByteBuffer,%20com.datastax.driver.core.ProtocolVersion)]
(but in most cases, you shouldn't even have to bother with that).

So closing as invalid, but if you think I'm misunderstood something and there does is a bug
in {{MapType.compose}}, please provide more context on what you're doing exactly.

> MapType.compose throws java.lang.IllegalArgumentException: null when either of the key
or value pair in map type object is of type int (Int32Type)
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-8813
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8813
>             Project: Cassandra
>          Issue Type: Bug
>          Components: API, Drivers (now out of tree)
>            Reporter: Chhavi Gangwal
>             Fix For: 2.1.4
>
>
> {code}java.lang.IllegalArgumentException: null at java.nio.Buffer.limit(Buffer.java:267)
~[na:1.7.0] 	at org.apache.cassandra.utils.ByteBufferUtil.readBytes(ByteBufferUtil.java:543)
~[cassandra-all-2.1.2.jar:2.1.2] 	at org.apache.cassandra.serializers.CollectionSerializer.readValue(CollectionSerializer.java:122)
~[cassandra-all-2.1.2.jar:2.1.2] 	at org.apache.cassandra.serializers.MapSerializer.deserializeForNativeProtocol(MapSerializer.java:99)
~[cassandra-all-2.1.2.jar:2.1.2] 	at org.apache.cassandra.serializers.MapSerializer.deserializeForNativeProtocol(MapSerializer.java:28)
~[cassandra-all-2.1.2.jar:2.1.2] 	at org.apache.cassandra.serializers.CollectionSerializer.deserialize(CollectionSerializer.java:48)
~[cassandra-all-2.1.2.jar:2.1.2] 	at org.apache.cassandra.db.marshal.AbstractType.compose(AbstractType.java:66)
~[cassandra-all-2.1.2.jar:2.1.2]
> {code}
> The issue mainly occurs due to forced readBytes function in CollectionSerializer with
version 3 for all collection types as well as UDT



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message