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 E38659F0C for ; Thu, 16 Feb 2012 08:30:51 +0000 (UTC) Received: (qmail 29543 invoked by uid 500); 16 Feb 2012 08:30:49 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 29521 invoked by uid 500); 16 Feb 2012 08:30:49 -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 29513 invoked by uid 99); 16 Feb 2012 08:30:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Feb 2012 08:30:49 +0000 X-ASF-Spam-Status: No, hits=3.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.220.172] (HELO mail-vx0-f172.google.com) (209.85.220.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Feb 2012 08:30:43 +0000 Received: by vcbfk14 with SMTP id fk14so1530095vcb.31 for ; Thu, 16 Feb 2012 00:30:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.90.169 with SMTP id bx9mr628524vdb.60.1329381021291; Thu, 16 Feb 2012 00:30:21 -0800 (PST) Received: by 10.220.228.202 with HTTP; Thu, 16 Feb 2012 00:30:21 -0800 (PST) In-Reply-To: <1329371895592-7290072.post@n2.nabble.com> References: <1329371895592-7290072.post@n2.nabble.com> Date: Thu, 16 Feb 2012 09:30:21 +0100 Message-ID: Subject: Re: CQL query issue when fetching data from Cassandra From: "R. Verlangen" To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=20cf3071cc148b95a404b910a3e8 X-Gm-Message-State: ALoCoQmOqYqRnmApJuKXpJyAKMZOeytpMEXFbooDi/hP52go64ojUa1WeD4uQTXonTpqn4v4IPh/ --20cf3071cc148b95a404b910a3e8 Content-Type: text/plain; charset=ISO-8859-1 I'm not sure about your first 2 questions. The third might be an exception: check your Cassandra logs. About the "like"-thing: there's no such query possibiliy in Cassandra / CQL. You can take a look at Hadoop / Hive to tackle those problems. 2012/2/16 Roshan > Hi > > I am using Cassandra 1.0.6 version and having one column family in my > keyspace. > > create column family TestCF > with comparator = UTF8Type > and column_metadata = [ > {column_name : userid, > validation_class : BytesType, > index_name : userid_idx, > index_type : KEYS}, > {column_name : workspace, > validation_class : BytesType, > index_name : wp_idx, > index_type : KEYS}, > {column_name : module, > validation_class : BytesType, > index_name : module_idx, > index_type : KEYS}, > {column_name : action, > validation_class : BytesType, > index_name : action_idx, > index_type : KEYS}, > {column_name : description, > validation_class : BytesType}, > {column_name : status, > validation_class : BytesType, > index_name : status_idx, > index_type : KEYS}, > {column_name : createdtime, > validation_class : BytesType}, > {column_name : created, > validation_class : BytesType, > index_name : created_idx, > index_type : KEYS}, > {column_name : logdetail, > validation_class : BytesType}] > and keys_cached = 10000 > and rows_cached = 1000 > and row_cache_save_period = 0 > and key_cache_save_period = 3600 > and memtable_throughput = 255 > and memtable_operations = 0.29; > > 1). The "IN" operator is not working > SELECT * FROM TestCF WHERE status IN ('Failed', 'Success') > 2) The "OR" operator is not fetching data. > SELECT * FROM TestCF WHERE status='Failed' OR status='Success' > 3) If I use "AND" operator, it also not sending data. Query doesn't have > issues, but result set is null. > SELECT * FROM TestCF WHERE status='Failed' AND status='Success' > 4) Is there any thing similar to "LIKE" in CQL? I want to search data based > on some part of string. > > Could someone please help me to solve the above issues? Thanks. > > > > -- > View this message in context: > http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/CQL-query-issue-when-fetching-data-from-Cassandra-tp7290072p7290072.html > Sent from the cassandra-user@incubator.apache.org mailing list archive at > Nabble.com. > --20cf3071cc148b95a404b910a3e8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I'm not sure about your first 2 questions. The third might be an except= ion: check your Cassandra logs.=A0

About the "like&= quot;-thing: there's no such query possibiliy in Cassandra / CQL.

You can take a look at Hadoop / Hive to tackle those pr= oblems.

2012/2/16 Roshan <codevally@gmail.com>
Hi

I am using Cassandra 1.0.6 version and having one column family in my
keyspace.

create column family TestCF
=A0 =A0with comparator =3D UTF8Type
=A0 =A0and column_metadata =3D [
=A0 =A0 =A0 =A0{column_name : userid,
=A0 =A0 =A0 =A0validation_class : BytesType,
=A0 =A0 =A0 =A0index_name : userid_idx,
=A0 =A0 =A0 =A0index_type : KEYS},
=A0 =A0 =A0 =A0{column_name : workspace,
=A0 =A0 =A0 =A0validation_class : BytesType,
=A0 =A0 =A0 =A0index_name : wp_idx,
=A0 =A0 =A0 =A0index_type : KEYS},
=A0 =A0 =A0 =A0{column_name : module,
=A0 =A0 =A0 =A0validation_class : BytesType,
=A0 =A0 =A0 =A0index_name : module_idx,
=A0 =A0 =A0 =A0index_type : KEYS},
=A0 =A0 =A0 =A0{column_name : action,
=A0 =A0 =A0 =A0validation_class : BytesType,
=A0 =A0 =A0 =A0index_name : action_idx,
=A0 =A0 =A0 =A0index_type : KEYS},
=A0 =A0 =A0 =A0{column_name : description,
=A0 =A0 =A0 =A0validation_class : BytesType},
=A0 =A0 =A0 =A0{column_name : status,
=A0 =A0 =A0 =A0validation_class : BytesType,
=A0 =A0 =A0 =A0index_name : status_idx,
=A0 =A0 =A0 =A0index_type : KEYS},
=A0 =A0 =A0 =A0{column_name : createdtime,
=A0 =A0 =A0 =A0validation_class : BytesType},
=A0 =A0 =A0 =A0{column_name : created,
=A0 =A0 =A0 =A0validation_class : BytesType,
=A0 =A0 =A0 =A0index_name : created_idx,
=A0 =A0 =A0 =A0index_type : KEYS},
=A0 =A0 =A0 =A0{column_name : logdetail,
=A0 =A0 =A0 =A0validation_class : BytesType}]
=A0 =A0and keys_cached =3D 10000
=A0 =A0and rows_cached =3D 1000
=A0 =A0and row_cache_save_period =3D 0
=A0 =A0and key_cache_save_period =3D 3600
=A0 =A0and memtable_throughput =3D 255
=A0 =A0and memtable_operations =3D 0.29;

1). The "IN" operator is not working
=A0 =A0 SELECT * FROM TestCF WHERE status IN ('Failed', 'Succe= ss')
2) The "OR" operator is not fetching data.
=A0 =A0SELECT * FROM TestCF WHERE status=3D'Failed' OR status=3D&#= 39;Success'
3) If I use "AND" operator, it also not sending data. Query doesn= 't have
issues, but result set is null.
=A0 =A0SELECT * FROM TestCF WHERE status=3D'Failed' AND status=3D&= #39;Success'
4) Is there any thing similar to "LIKE" in CQL? I want to search = data based
on some part of string.

Could someone please help me to solve the above issues? Thanks.



--
View this message in context: http://cassandra-user-incub= ator-apache-org.3065146.n2.nabble.com/CQL-query-issue-when-fetching-data-fr= om-Cassandra-tp7290072p7290072.html
Sent from the cassan= dra-user@incubator.apache.org mailing list archive at Nabble.com.

--20cf3071cc148b95a404b910a3e8--