cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Resolved] (CASSANDRA-8438) Nested collections not serialized with respect to native protocol version
Date Mon, 08 Dec 2014 17:04:12 GMT


Sylvain Lebresne resolved CASSANDRA-8438.
    Resolution: Not a Problem

This is known and not a bug. Because "inner" collections are stored in Cassandra as-is, we
decided to force the protocol v3 encoding, even in the protocol v2. We're aware that it's
awkward, but mostly that just mean that if you plan on using/supporting UDT, you better go
with a client that supports the v3 protocol.

> 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