Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ECAFD200BF6 for ; Tue, 10 Jan 2017 22:00:52 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EB328160B3D; Tue, 10 Jan 2017 21:00:52 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E6E7B160B2C for ; Tue, 10 Jan 2017 22:00:51 +0100 (CET) Received: (qmail 56685 invoked by uid 500); 10 Jan 2017 21:00:50 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 56675 invoked by uid 99); 10 Jan 2017 21:00:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jan 2017 21:00:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id F328B180140 for ; Tue, 10 Jan 2017 21:00:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.619 X-Spam-Level: X-Spam-Status: No, score=-0.619 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_REPLYTO_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id ab9Tm477vB5T for ; Tue, 10 Jan 2017 21:00:47 +0000 (UTC) Received: from nm6.bullet.mail.ne1.yahoo.com (nm6.bullet.mail.ne1.yahoo.com [98.138.90.69]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id A838A5F4A6 for ; Tue, 10 Jan 2017 21:00:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1484082040; bh=D4bdOdbnzKfI/e6wLw+8hfGbygRDN9pFfa76ARsG9ic=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=J9z3Ok5J2ei2th8ENWJXb2BWwp1DjRHSgMVJU/PGHOGGTepoMtAopimANjHMBtC6yqWv2AP1tU/iQngY4VkmaytgYcsXQ4h6PyYmMDy5cUHPhLB9uBv5ognmA/+6faOPmgVORgxl1pPEum+AIlrOqvVAcAylijauwW6dCHtnDvCaABlJFLtwSIZ4z03Sau/Sl2gNq782Dch1V1GHrTMjkg/qrjRS69SkpS7hIPXekVYBCzWvGR9rUHdENbeYovH/HK3sNoMYur8OrKl490uqDWSnyJZ+usgETWllm52TpUXts+60+x0robBAP1ylZ0WcpV+N9ulq9VWEZKbWiB1jGA== Received: from [98.138.100.116] by nm6.bullet.mail.ne1.yahoo.com with NNFMP; 10 Jan 2017 21:00:40 -0000 Received: from [98.138.89.197] by tm107.bullet.mail.ne1.yahoo.com with NNFMP; 10 Jan 2017 21:00:40 -0000 Received: from [127.0.0.1] by omp1055.mail.ne1.yahoo.com with NNFMP; 10 Jan 2017 21:00:40 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 830106.40083.bm@omp1055.mail.ne1.yahoo.com X-YMail-OSG: wXInrd8VM1lTXxWJLyT97eystv6l6dqemnQueaKZwV5UrXFNrptxhj6pM7snYkS QqrlR9nBZ8Tkq4jIQ6MiTk86J_fj4Ikrtav6ECorCtPcODfCTJagMsA8NNkITbFFc0CU4hngco2j 9ParrTQPTUHsJQHB6t.sO7Vm9AyfqptjKfyd67AJIuA.zcwDSQVg35zhM9WZDi.qCki8UqHMaRSU 4T3uhMS0buq2A..wVFHSBEbl9KofyafjicjcdM9quASw0PlYMhXLRmHxJXq4uNzLI42VlZtYpkqD 6Um0zVtuvdfrNSDgKwfkXRTBAnTy8.U9N1.BbBM2hXNk.mAvOwlniGICKNr7n4l9U0Sh0C_ay9em jJap2MDxX3egdYkEqYnuIqHxR73TYL49k8OvVY_oIyNDQiGkPYVT334hBS5Bk9iRXAM3766m9lqw TpzM.ISL2TUsBB2lJ2HJ8qtEvuFw4B4bhQoBsMLcz8iKBPDJQ1G_EQGK64Q4ds7zZBrRYM2mJ9Ly kFBtIUPkIQF4JNd3PgkOX4bSyoIjxvyB8rHPDYPfgtkLCH.b0_6P5nQu5.GYeHt9JLh3wOA8lqyG kaI6SHpf5tpTQ1a9cUR_PidZM9wAARwb0E5T439Krim9xY55KU5BZdaREJh5Vuagf_Nl.CqezAMC gm07nYA-- Received: from jws200121.mail.ne1.yahoo.com by sendmailws145.mail.ne1.yahoo.com; Tue, 10 Jan 2017 21:00:40 +0000; 1484082040.459 Date: Tue, 10 Jan 2017 21:00:34 +0000 (UTC) From: Sotirios Delimanolis Reply-To: Sotirios Delimanolis To: User Message-ID: <2012109458.622517.1484082034764@mail.yahoo.com> Subject: Documented CQL limits seem to be wrong (how are sets and lists implemented in the storage layer) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_622516_1594186333.1484082034760" References: <2012109458.622517.1484082034764.ref@mail.yahoo.com> archived-at: Tue, 10 Jan 2017 21:00:53 -0000 ------=_Part_622516_1594186333.1484082034760 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable We're using Cassandra 2.2. This document=C2=A0lists a number of CQL limits.=C2=A0I'm particularly inte= rested in the Collection limits for Set and List. If I've interpreted it co= rrectly, the document states that values in Sets are limited to 65535 bytes= .=C2=A0 This limit, as far as I know, exists because the set identity is implemente= d with a composite value in the column name of the storage engine's cell (s= imilar to the clustering column value limit), which CQL restricts to that m= any bytes. (Is this correct?) Consider a table like CREATE TABLE test.bounds (=C2=A0 =C2=A0 someid text,=C2=A0 =C2=A0 someorder= =C2=A0text,=C2=A0 =C2=A0 words=C2=A0set, =C2=A0 =C2=A0 PRIMARY KEY (guid, deviceid)) with=C2=A0 PreparedStatement ps =3D session.prepare("INSERT INTO bounds (someid, someo= rder, epset) VALUES (?, ?, ?)");BoundStatement bs =3D ps.bind("id", "order"= , ImmutableSet.of(StringUtils.repeat('a', 66000)));session.execute(bs); This will throw the expected exception Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: The s= um of all clustering columns is too long (66024 > 65535) Now if I change the table to use a List instead of a Set CREATE TABLE test.bounds (=C2=A0 =C2=A0=C2=A0someid text,=C2=A0 =C2=A0 some= order=C2=A0text,=C2=A0 =C2=A0 words=C2=A0Set, =C2=A0 =C2=A0=C2=A0PRIMARY KEY (guid, deviceid)) and use BoundStatement=C2=A0bs=C2=A0=3D=C2=A0ps.bind("id",=C2=A0"order", ImmutableL= ist.of(StringUtils.repeat('a', 66000))); I do not receive an exception. The document, however, states that List valu= e sizes are also limited to 65535 bytes. Is the document incorrect or am I = misinterpreting? I assumed List values are implemented as simple column values in the underl= ying storage and the order is maintained through their timestamps. ------=_Part_622516_1594186333.1484082034760 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
We're using Cassandra 2.2.

This docume= nt lists a number of CQL limits. I'm particularly interested in t= he Collection limits for Set and List. If I've interpreted it correctly, th= e document states that values in Sets are limited to 65535 bytes. 

This limit, as f= ar as I know, exists because the set identity is implemented with a composi= te value in the column name of the storage engine's cell (similar to the cl= ustering column value limit), which CQL restricts to that many bytes. (Is t= his correct?)

Consider a table like

CREATE TABLE tes= t.bounds (
    someid text,
    someorder text,
&nb= sp;   words set<text>,
    PRIMARY KEY (guid, deviceid)
)

with 

Prepa= redStatement ps =3D session.prepare("INSERT INTO bounds (some= id, someorder, epset) VALUES (?, ?, ?)");
B= oundStatement bs = =3D ps.bind("id", "order", ImmutableSet.of(StringUt= ils.repeat('a', 6= 6000)));
session.execute(bs);

This will throw the expected = exception
Caused by: com.datastax.driver.core.excepti= ons.InvalidQueryException: The sum of all clustering columns is too = long (66024 > 65535)

Now if I change the table to u= se a List instead of a Set

CREATE TABLE test.bounds (
    someid text,
    someorder text,=
    words Set<text>,
    PRIMARY KEY (guid, device= id)
)


=
BoundStatement bs =3D ps.bind("id""order", ImmutableList.of(StringUtils.repeat= ('a', 66000)));

I do not receive an exception. The document, however, states that Li= st value sizes are also limited to 65535 bytes. Is the document incorrect o= r am I misinterpreting?

I assumed List values are implemented as si= mple column values in the underlying storage and the order is maintained th= rough their timestamps.

------=_Part_622516_1594186333.1484082034760--