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 D4ACB4922 for ; Wed, 29 Jun 2011 02:19:24 +0000 (UTC) Received: (qmail 16868 invoked by uid 500); 29 Jun 2011 02:19:22 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 16843 invoked by uid 500); 29 Jun 2011 02:19:21 -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 16834 invoked by uid 99); 29 Jun 2011 02:19:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2011 02:19:21 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tyler@datastax.com designates 74.125.83.44 as permitted sender) Received: from [74.125.83.44] (HELO mail-gw0-f44.google.com) (74.125.83.44) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2011 02:19:17 +0000 Received: by gwb20 with SMTP id 20so398927gwb.31 for ; Tue, 28 Jun 2011 19:18:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.73.20 with SMTP id v20mr209354yba.368.1309313935318; Tue, 28 Jun 2011 19:18:55 -0700 (PDT) Received: by 10.150.205.6 with HTTP; Tue, 28 Jun 2011 19:18:55 -0700 (PDT) X-Originating-IP: [70.112.94.57] In-Reply-To: References: Date: Tue, 28 Jun 2011 21:18:55 -0500 Message-ID: Subject: Re: Problem with PHPCassa accessing Indexes From: Tyler Hobbs To: user@cassandra.apache.org, phpcassa@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable The output of 'describe keyspace' would be useful for figuring this out, at well. On Tue, Jun 28, 2011 at 5:10 PM, Jean-Nicolas Boulay Desjardins wrote: > Sorry, my mistake. The variable name was wrong. Weird, I did not get any = errors. > > Thanks anyways. > > But I do Have a another question. When looking in cassandra-cli I did > "get Users[jnbdz];" and I got: > > A long is exactly 8 bytes: 10 > > And I don't get the data. > > Am I missing something? > > Thanks in advance. > > On Tue, Jun 28, 2011 at 6:00 PM, Tyler Hobbs wrote: >> What does the ouput of 'describe keyspace ' show for the >> keyspace the CF is in? >> >> On Tue, Jun 28, 2011 at 2:35 PM, Jean-Nicolas Boulay Desjardins >> wrote: >>> Actually I am not getting any results from: get_indexed_slices() >>> >>> It seems my code dies at: $rows =3D >>> $column_family->get_indexed_slices($index_clause); >>> >>> Because everything after that is echo is not shown on the page. >>> >>> Plus I don't get any errors. >>> >>> Any ideas? >>> >>> On Tue, Jun 28, 2011 at 3:23 PM, Tyler Hobbs wrote= : >>>> The result of get_indexed_slices() is an Iterator object, not an >>>> array. =A0It doesn't look like you're treating it accordingly. >>>> >>>> See the bottom of this section for an example: >>>> http://thobbs.github.com/phpcassa/tutorial.html#indexes >>>> >>>> On Tue, Jun 28, 2011 at 2:06 PM, Jean-Nicolas Boulay Desjardins >>>> wrote: >>>>> Hi, >>>>> >>>>> I am having problem accessing data via an index with PHPCassa. I have >>>>> var_dump() the results: >>>>> >>>>> array(6) { ["birthdate"]=3D> int(3546927995491989807) ["email"]=3D> >>>>> string(20) "jnbdzjnbdz@gmail.com" ["firstname"]=3D> string(12) >>>>> "Jean-Nicolas" ["lastname"]=3D> string(17) "Boulay Desjardins" >>>>> ["password"]=3D> string(8) "password" ["username"]=3D> string(5) "jnb= dz" } >>>>> >>>>> object(cassandra_IndexExpression)#76 (3) { ["column_name"]=3D> string= (5) >>>>> "email" ["op"]=3D> int(0) ["value"]=3D> string(20) "jnbdzjnbdz@gmail.= com" >>>>> } >>>>> >>>>> object(cassandra_IndexClause)#77 (3) { ["expressions"]=3D> array(1) { >>>>> [0]=3D> object(cassandra_IndexExpression)#76 (3) { ["column_name"]=3D= > >>>>> string(5) "email" ["op"]=3D> int(0) ["value"]=3D> string(20) >>>>> "jnbdzjnbdz@gmail.com" } } ["start_key"]=3D> string(0) "" ["count"]= =3D> >>>>> int(100) } >>>>> >>>>> Here is the code: >>>>> >>>>> $columnFamily =3D CASSANDRA::selectColumnFamily('Users'); >>>>> >>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 $this->selectUser =3D $= columnFamily->get('jnbdz'); >>>>> >>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 var_dump($this->selectU= ser); >>>>> >>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo '
'; >>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo '
'; >>>>> >>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 $index_exp =3D >>>>> CassandraUtil::create_index_expression('email', >>>>> 'jnbdzjnbdz@gmail.com'); >>>>> var_dump($index_exp); >>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 $index_clause =3D >>>>> CassandraUtil::create_index_clause(array($index_exp)); >>>>> echo '
'; >>>>> echo '
'; >>>>> var_dump($index_clause); >>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 $rows =3D $column_famil= y->get_indexed_slices($index_clause); >>>>> echo '
'; >>>>> echo '
'; >>>>> var_dump($rows); >>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 var_dump($row); >>>>> >>>>> Thanks in advance for any help >>>>> >>>> >>>> >>>> >>>> -- >>>> Tyler Hobbs >>>> Software Engineer, DataStax >>>> Maintainer of the pycassa Cassandra Python client library >>>> >>> >>> >>> >>> -- >>> Name / Nom: Boulay Desjardins, Jean-Nicolas >>> Website / Site Web: www.jeannicolas.com >>> >> >> >> >> -- >> Tyler Hobbs >> Software Engineer, DataStax >> Maintainer of the pycassa Cassandra Python client library >> > > > > -- > Name / Nom: Boulay Desjardins, Jean-Nicolas > Website / Site Web: www.jeannicolas.com > --=20 Tyler Hobbs Software Engineer, DataStax Maintainer of the pycassa Cassandra Python client library