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 70E1D73A8 for ; Mon, 15 Aug 2011 23:46:23 +0000 (UTC) Received: (qmail 62284 invoked by uid 500); 15 Aug 2011 23:46:21 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 62127 invoked by uid 500); 15 Aug 2011 23:46:20 -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 62113 invoked by uid 99); 15 Aug 2011 23:46:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2011 23:46:20 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of derek.deeter@digitalinsight.com designates 208.29.163.248 as permitted sender) Received: from [208.29.163.248] (HELO warden-p.diginsite.com) (208.29.163.248) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2011 23:46:13 +0000 X-SBRS: None X-IronPort-AV: E=Sophos;i="4.67,377,1309762800"; d="scan'208,217";a="124849993" Received: from blackbird.digitalinsight.com (HELO blackbird1-p.diginsite.com) ([10.201.7.73]) by warden-p.diginsite.com with ESMTP; 15 Aug 2011 16:45:51 -0700 Received: from wlvexf01.corp.ad.diginsite.com ([172.18.98.125]) by blackbird1-p.diginsite.com (Tablus Interceptor) for ; Mon, 15 Aug 2011 16:45:50 -0700 Received: from CALEXM01.corp.ad.diginsite.com ([172.18.98.27]) by wlvexf01.corp.ad.diginsite.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 15 Aug 2011 16:45:49 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CC5BA5.763D2235" Subject: CQL query using 'OR' in WHERE clause Date: Mon, 15 Aug 2011 16:45:49 -0700 Message-ID: <43E9ACAAA8517342B17B5A7DF620F1DC127CE0FA@CALEXM01.corp.ad.diginsite.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: CQL query using 'OR' in WHERE clause Thread-Index: AcxbpXXgBbFAQ7YOQGi5bo5u8+r6LA== From: "Deeter, Derek" To: X-OriginalArrivalTime: 15 Aug 2011 23:45:49.0444 (UTC) FILETIME=[76017440:01CC5BA5] X-Tablus-Inspected: yes X-Tablus-Classifications: public X-Tablus-Action: allow X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. ------_=_NextPart_001_01CC5BA5.763D2235 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, We are using CQL to obtain data from Cassandra 0.8.1 using Hector and getting an error when using 'OR' on a secondary index. I get the same error when using CQL 1.0.3. All the items in the WHERE clause are secondary indices and they are all UTF8Type validation. The query works when leaving out everything from 'OR' onwards. Example: cqlsh> SELECT '.id' , '.ipAddress' , '.userProduct' , '.offeringId' , '.appId', 'timeStamp', '.logType', '.tzOffset' , '.id' , 'member' , 'mfaEnrolled' , 'sessionId' , 'startPage' , 'timeStamp' FROM Audit_Log USING CONSISTENCY ONE WHERE '.bcId' =3D '01112' AND '.userProduct' =3D 'IB' AND 'timeStamp' >=3D 1312182000000 AND '.logType' =3D 'login' OR '.logType' =3D 'badLogin'; Bad Request: line 1:336 mismatched input 'OR' expecting EOF I also tried to use the 'IN' keyword to no avail: cqlsh> SELECT '.id' , '.ipAddress' , '.userProduct' , '.offeringId' , '.appId', 'timeStamp', '.logType', '.tzOffset' , '.id' , 'member' , 'mfaEnrolled' , 'sessionId' , 'startPage' , 'timeStamp' FROM Audit_Log USING CONSISTENCY ONE WHERE '.bcId' =3D '01112' AND '.userProduct' =3D 'IB' AND 'timeStamp' >=3D 1312182000000 AND '.logType' IN ( 'login', 'badLogin'); Bad Request: line 1:326 mismatched input 'IN' expecting set null I also tried simplifying the query WHERE clause to only "WHERE '.logType' =3D 'login' OR '.logType' =3D 'badLogin';" but get the same 'mismatched input' error. Is there any way to set up a query on a set of values such as the above? Or do I have the syntax wrong? Thanks in advance, -Derek Derek Deeter Software Engineer, Sr =20 o: 818-597-5932 | m: 661-645-7842 | f: 818-878-7555 This email may contain confidential and privileged material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ------_=_NextPart_001_01CC5BA5.763D2235 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable CQL query using 'OR' in WHERE clause

Hi,

We are using = CQL to obtain data from Cassandra 0.8.1 using Hector and = getting an error when using OR on a secondary = index.  I get the same error when = using CQL 1.0.3.  All the = items in the WHERE clause are secondary indices and they are = all UTF8Type validation.  The query = works = when leaving out everything = from = OR = onwards.   Example:

cqlsh> SELECT '.id' , '.ipAddress' , '.userProduct' = , '.offeringId' , '.appId', 'timeStamp', '.logType', '.tzOffset'  , = '.id' , 'member' , 'mfaEnrolled' , 'sessionId' , 'startPage' , = 'timeStamp' FROM Audit_Log USING CONSISTENCY ONE WHERE '.bcId' =3D  = '01112' AND '.userProduct' =3D  'IB' AND 'timeStamp' >=3D  = 1312182000000 AND '.logType' =3D 'login' OR '.logType' =3D = 'badLogin';

Bad Request: = line 1:336 mismatched input 'OR' expecting EOF

I also tried to = use the IN keyword to no = avail:

cqlsh> SELECT '.id' , '.ipAddress' , '.userProduct' = , '.offeringId' , '.appId', 'timeStamp', '.logType', '.tzOffset'  , = '.id' , 'member' , 'mfaEnrolled' , 'sessionId' , 'startPage' , = 'timeStamp' FROM Audit_Log USING CONSISTENCY ONE WHERE '.bcId' =3D  = '01112' AND '.userProduct' =3D  'IB' AND 'timeStamp' >=3D  = 1312182000000 AND '.logType' IN ( 'login', = 'badLogin');

Bad Request: line 1:326 mismatched input 'IN' expecting = set null

I also tried = simplifying the query WHERE clause = to only WHERE '.logType' =3D 'login' OR '.logType' =3D = 'badLogin';  but = get the same mismatched = input error Is there any way to set up a = query on a set of values such as the = above?  Or do I have the syntax = wrong?

        Thanks in advance,

        -Derek


Derek Deeter
Software Engineer, Sr

o: 818-597-5932  |  m: = 661-645-7842  |  f: 818-878-7555

This = email may contain confidential and privileged material for the sole use = of the intended recipient. Any review or distribution by = others is = strictly prohibited. If you are not the intended recipient, please = contact the sender and delete all copies.

------_=_NextPart_001_01CC5BA5.763D2235--