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 97BEA17F72 for ; Thu, 26 Feb 2015 03:07:56 +0000 (UTC) Received: (qmail 32196 invoked by uid 500); 26 Feb 2015 03:07:53 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 32158 invoked by uid 500); 26 Feb 2015 03:07:53 -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 32148 invoked by uid 99); 26 Feb 2015 03:07:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Feb 2015 03:07:53 +0000 X-ASF-Spam-Status: No, hits=3.4 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of java8964@hotmail.com designates 65.55.90.163 as permitted sender) Received: from [65.55.90.163] (HELO SNT004-OMC3S24.hotmail.com) (65.55.90.163) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Feb 2015 03:07:47 +0000 Received: from SNT149-W79 ([65.55.90.135]) by SNT004-OMC3S24.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Wed, 25 Feb 2015 19:07:05 -0800 X-TMN: [e8Rbv+rdK8wGcL1WOc3secwTkGDSy8HV] X-Originating-Email: [java8964@hotmail.com] Message-ID: Content-Type: multipart/alternative; boundary="_5ad288b4-a1b3-46da-8c04-f8b495068439_" From: java8964 To: "user@cassandra.apache.org" Subject: RE: Why and How I didn't get the result back in cqlsh Date: Wed, 25 Feb 2015 22:07:05 -0500 Importance: Normal In-Reply-To: <54EE8B08.9040901@gmail.com> References: ,<54EE8B08.9040901@gmail.com> MIME-Version: 1.0 X-OriginalArrivalTime: 26 Feb 2015 03:07:05.0603 (UTC) FILETIME=[4CD69530:01D05171] X-Virus-Checked: Checked by ClamAV on apache.org --_5ad288b4-a1b3-46da-8c04-f8b495068439_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi=2C Duncan: Thanks for your reply=2C but it didn't help. yzhang@yzhangmac1:~/dse/bin$ ./cqlsh hostname 9160 -u user -p passwordConne= cted to P2 QA Cluster at xxx:9160.[cqlsh 3.1.2 | Cassandra 1.2.18.1 | CQL s= pec 3.0.0 | Thrift protocol 19.36.2]Use HELP for help.cqlsh> use myKeyspace= =3Bcqlsh:myKeyspace > consistency all=3BConsistency level set to ALL.cqlsh:= myKeyspace> select * from "myTable" where "key"=3D59 and "key2"=3D336=3Bcq= lsh: myKeyspace > select * from "myTable" where key=3D59 and key2=3D336=3Bc= qlsh: myKeyspace > This table in fact was created by old column family way in Cassandra 1.1=2C= using composite key and composite column names.After we upgrade to Cassand= ra 1.2=2C you can see the column name in CQL comes from the Cassandra. So t= his table is NOT created in CQL. I think it maybe due to the column name "key" is a reserved word. But even = I quote it like "key" in the CQL query=2C it still didn't help. > Date: Thu=2C 26 Feb 2015 03:55:04 +0100 > From: duncan.sands@gmail.com > To: user@cassandra.apache.org > Subject: Re: Why and How I didn't get the result back in cqlsh >=20 > Hi=2C >=20 > On 26/02/15 01:24=2C java8964 wrote: > ... > > select * from "myTable"=3B > > 59 | 336 | 1100390163336 | A | > > [{"updated_at":1424844362530=2C"ids":"668e5520-bb71-11e4-aecd-00163e56b= e7c"}] > > 59 | 336 | 1100390163336 | D | > > [{"updated_at":1424844365062=2C"ids":"668e5520-bb71-11e4-aecd-00163e56b= e7c"}] > > > > Obviously=2C the table has lots of data. Now the problem is I cannot ge= t any data > > back in my query using key of existing data. Why? > > > > cqlsh:mykeyspace> select * from "myTable" where key=3D59 and key2=3D336= =3B > > cqlsh:mykeyspace> select * from "myTable" where "key"=3D59 and "key2"= =3D336=3B >=20 > try at a higher consistency level=2C eg first do this in cqlsh: > CONSISTENCY ALL=3B > then try your queries. If that works then the issue is that some replica= s are=20 > missing data. The default cqlsh consistency level is ONE. >=20 > Best wishes=2C Duncan. = --_5ad288b4-a1b3-46da-8c04-f8b495068439_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi=2C Duncan:

Thanks for your reply=2C but it didn't help.

yzhang@yzhangmac1:~/dse/bin$ ./cqlsh hostname 9160 -u user -p password
Connected to P2 QA Cluster at xxx:9160.
[cqlsh 3.1.2 | Cas= sandra 1.2.18.1 | CQL spec 3.0.0 | Thrift protocol 19.36.2]
Use H= ELP for help.
cqlsh>=3B use myKeyspace=3B
cqlsh:myKey= space =3B>=3B consistency all=3B
Consistency level set to A= LL.
cqlsh: =3BmyKeyspace>=3B select * from "myTable" where = "key"=3D59 and "key2"=3D336=3B
cqlsh: =3BmyKeyspace =3B= >=3B select * from "myTable" where key=3D59 and key2=3D336=3B
cqlsh: =3BmyKeyspace =3B>=3B

This = table in fact was created by old column family way in Cassandra 1.1=2C usin= g composite key and composite column names.
After we upgrade to C= assandra 1.2=2C you can see the column name in CQL comes from the Cassandra= . So this table is NOT created in CQL.

I think it = maybe due to the column name "key" is a reserved word. But even I quote it = like "key" in the CQL query=2C it still didn't help.

>=3B D= ate: Thu=2C 26 Feb 2015 03:55:04 +0100
>=3B From: duncan.sands@gmail.c= om
>=3B To: user@cassandra.apache.org
>=3B Subject: Re: Why and H= ow I didn't get the result back in cqlsh
>=3B
>=3B Hi=2C
>= =3B
>=3B On 26/02/15 01:24=2C java8964 wrote:
>=3B ...
>=3B= >=3B select * from "myTable"=3B
>=3B >=3B 59 | 336 | 11003901= 63336 | A |
>=3B >=3B [{"updated_at":1424844362530=2C"ids":"668e5520= -bb71-11e4-aecd-00163e56be7c"}]
>=3B >=3B 59 | 336 | 11003901633= 36 | D |
>=3B >=3B [{"updated_at":1424844365062=2C"ids":"668e5520-bb= 71-11e4-aecd-00163e56be7c"}]
>=3B >=3B
>=3B >=3B Obviously=2C= the table has lots of data. Now the problem is I cannot get any data
&g= t=3B >=3B back in my query using key of existing data. Why?
>=3B >= =3B
>=3B >=3B cqlsh:mykeyspace>=3B select * from "myTable" where k= ey=3D59 and key2=3D336=3B
>=3B >=3B cqlsh:mykeyspace>=3B select * = from "myTable" where "key"=3D59 and "key2"=3D336=3B
>=3B
>=3B tr= y at a higher consistency level=2C eg first do this in cqlsh:
>=3B = CONSISTENCY ALL=3B
>=3B then try your queries. If that works then the= issue is that some replicas are
>=3B missing data. The default cqls= h consistency level is ONE.
>=3B
>=3B Best wishes=2C Duncan.
=
= --_5ad288b4-a1b3-46da-8c04-f8b495068439_--