cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Holmberg (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-8438) Nested collections not serialized with respect to native protocol version
Date Tue, 09 Dec 2014 18:36:12 GMT


Adam Holmberg commented on CASSANDRA-8438:

A tag could work. I was aware of CASSANDRA-8043 for keeping an eye on new protocol updates,
but as you say it would also be useful to be aware of impactful serialization decisions.

> Nested collections not serialized with respect to native protocol version
> -------------------------------------------------------------------------
>                 Key: CASSANDRA-8438
>                 URL:
>             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':
> 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

View raw message