Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1F55A107AF for ; Fri, 28 Feb 2014 05:58:05 +0000 (UTC) Received: (qmail 81176 invoked by uid 500); 28 Feb 2014 05:58:01 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 80857 invoked by uid 500); 28 Feb 2014 05:57:58 -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 80834 invoked by uid 99); 28 Feb 2014 05:57:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Feb 2014 05:57:56 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of clint.kelly@gmail.com designates 209.85.213.46 as permitted sender) Received: from [209.85.213.46] (HELO mail-yh0-f46.google.com) (209.85.213.46) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Feb 2014 05:57:51 +0000 Received: by mail-yh0-f46.google.com with SMTP id v1so234907yhn.5 for ; Thu, 27 Feb 2014 21:57:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=znC9xwOBNHJgMAKrGvvAIFENnzYB+b7WhA2+Bh9En3o=; b=Vt4uwUDQ1rd//I+h45FT9Nzd02kQMSVABlSFbaQRydzjoOIw6ncOFr1/Sphmh2qt3p of2iHvkImXbjlY6NrjsjhS1GJ1kILM2kobtTfFnXJYmLSBl8EziZocmJ96k/3F4zywmv huMnJ2rQ8A6FOTJDMhpmligssiA0WS25pukRHxq0lHVr2AmXaN4IOJMK8Q5e+f96stwi I8rKqsKWR8c+R62ARdVpLEdRPARWosOV644MMReRuXXNx0ojFBz9LOmh9BWBgwGApXTL O3eGyjVesP2A+96OOFTSslOxI4eF3SJJuESNJkDK67XKzLQUygyyiEXkckFZxZcejZ0m WQWQ== MIME-Version: 1.0 X-Received: by 10.236.19.162 with SMTP id n22mr968507yhn.23.1393567050809; Thu, 27 Feb 2014 21:57:30 -0800 (PST) Received: by 10.170.75.87 with HTTP; Thu, 27 Feb 2014 21:57:30 -0800 (PST) Date: Thu, 27 Feb 2014 21:57:30 -0800 Message-ID: Subject: CQL: Any way to have inequalities on multiple clustering columns in a WHERE clause? From: Clint Kelly To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=089e0160d0b608c6e304f3711d42 X-Virus-Checked: Checked by ClamAV on apache.org --089e0160d0b608c6e304f3711d42 Content-Type: text/plain; charset=ISO-8859-1 All, Is there any way to have inequalities comparisons on multiple clustering columns in a WHERE clause in CQL? For example, I'd like to do: select * from foo where fam = 'Info' and qual > 'A' and qual < 'D' and version > 2013 ALLOW FILTERING; I get an error: Bad Request: PRIMARY KEY part version cannot be restricted (preceding part qual is either not restricted or by a non-EQ relation) when I try this. Is there any way to make a query like this work? I understand that this query will not be a nice, continuous scan of data, but I'd rather have a slower query than have to do all of this filtering on the client side. Any other suggestions? BTW my table looks like this: CREATE TABLE foo ( key text, fam text, qual text, version int, val text, PRIMARY KEY (key, fam, qual, version) ) WITH bloom_filter_fp_chance=0.010000 AND caching='KEYS_ONLY' AND comment='' AND dclocal_read_repair_chance=0.000000 AND gc_grace_seconds=864000 AND index_interval=128 AND read_repair_chance=0.100000 AND replicate_on_write='true' AND populate_io_cache_on_flush='false' AND default_time_to_live=0 AND speculative_retry='99.0PERCENTILE' AND memtable_flush_period_in_ms=0 AND compaction={'class': 'SizeTieredCompactionStrategy'} AND compression={'sstable_compression': 'LZ4Compressor'}; Best regards, Clint --089e0160d0b608c6e304f3711d42 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
All,

Is there any way to = have inequalities comparisons on multiple clustering columns in a WHERE cla= use in CQL?=A0 For example, I'd like to do:

select * from foo wh= ere fam =3D 'Info' and qual > 'A' and qual < 'D&#= 39; and version > 2013 ALLOW FILTERING;

I get an error:

=A0=A0=A0 Bad Request: PRIMARY KEY p= art version cannot be restricted (preceding part qual is either not restric= ted or by a non-EQ relation)

when I try this.=A0 Is there any = way to make a query like this work?=A0 I understand that this query will no= t be a nice, continuous scan of data, but I'd rather have a slower quer= y than have to do all of this filtering on the client side.=A0 Any other su= ggestions?

BTW my table looks like this:

CREATE TABLE foo (
=A0 ke= y text,
=A0 fam text,
=A0 qual text,
=A0 version int,
=A0 val t= ext,
=A0 PRIMARY KEY (key, fam, qual, version)
) WITH
=A0 bloom_fi= lter_fp_chance=3D0.010000 AND
=A0 caching=3D'KEYS_ONLY' AND
=A0 comment=3D'' AND
= =A0 dclocal_read_repair_chance=3D0.000000 AND
=A0 gc_grace_seconds=3D864= 000 AND
=A0 index_interval=3D128 AND
=A0 read_repair_chance=3D0.10000= 0 AND
=A0 replicate_on_write=3D'true' AND
=A0 populate_io_cache_on_flush=3D'false' AND
=A0 default_time_to= _live=3D0 AND
=A0 speculative_retry=3D'99.0PERCENTILE' AND
= =A0 memtable_flush_period_in_ms=3D0 AND
=A0 compaction=3D{'class'= ;: 'SizeTieredCompactionStrategy'} AND
=A0 compression=3D{'sstable_compression': 'LZ4Compressor'};=

Best regards,
Clint
--089e0160d0b608c6e304f3711d42--