cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chhavi Gangwal (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 06:00:17 GMT

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

Chhavi Gangwal commented on CASSANDRA-8813:
-------------------------------------------

map is of type comments<int,text> and I am storing as well as retrieving int .The map
is stored by executing a query directly via cqlclient. The issue occurs when I try to retrieve
the map containing int value . My code looks something like this 

ByteBuffer valueByteBuffer = ByteBuffer.wrap((byte[]) columnValue);
             
MapType mapType = MapType.getInstance((AbstractType) keyClassInstance,
                       (AbstractType) valueClassInstance);
          
Map rawMap = new HashMap();
rawMap.putAll((Map) mapType.compose(valueByteBuffer));


> 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