cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Holmberg (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CASSANDRA-8438) Nested collections not serialized with respect to native protocol version
Date Mon, 08 Dec 2014 16:07:12 GMT
Adam Holmberg created CASSANDRA-8438:
----------------------------------------

             Summary: Nested collections not serialized with respect to native protocol version
                 Key: CASSANDRA-8438
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8438
             Project: Cassandra
          Issue Type: Bug
          Components: Core
            Reporter: Adam Holmberg
            Priority: Minor


It appears that inner collections are not encoding collection element count correctly for
protocol version <=2

{code}
from cassandra.cluster import Cluster
s = Cluster(protocol_version=2).connect()
s.execute("CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor':
'1'}")
s.execute("CREATE TABLE test.test (k int PRIMARY KEY, v map<int, frozen<list<int>>>)
s.execute("INSERT INTO test.test (k, v ) VALUES ( 1, {1: [2,3,4]})")
print s.execute("SELECT * FROM test.test")
{code}

The map returned is encoded as follows:
00:01:00:04:00:00:00:01:00:1c:*00:00:00:03*:*00:00:00:04*:00:00:00:02:*00:00:00:04*:00:00:00:03:*00:00:00:04*:00:00:00:04

It appears that the outer collection encoding is as expected, while the inner list count,
and list element sizes are _int_ size, instead of _short_. This does not manifest as a problem
in cqlsh because it uses protocol version 3 by default, which accepts this encoding.



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

Mime
View raw message