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 3C62110B1A for ; Fri, 20 Sep 2013 06:08:12 +0000 (UTC) Received: (qmail 67548 invoked by uid 500); 20 Sep 2013 06:08:08 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 67526 invoked by uid 500); 20 Sep 2013 06:08:05 -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 67515 invoked by uid 99); 20 Sep 2013 06:08:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Sep 2013 06:08:03 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of nagapad.0904@gmail.com designates 74.125.82.45 as permitted sender) Received: from [74.125.82.45] (HELO mail-wg0-f45.google.com) (74.125.82.45) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Sep 2013 06:07:58 +0000 Received: by mail-wg0-f45.google.com with SMTP id y10so8874496wgg.0 for ; Thu, 19 Sep 2013 23:07:37 -0700 (PDT) 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=n1n6KPgPw0yBClRACAZHVWr7PKhXoJQ5NMN7aut9ZLc=; b=a6urhdoXJ15ONTTZU/9zUruvQHWAbhZwro7WQ5lURtrK/FmOExklPRxJW/mCDYJPdn N4inBNTKdPkYSOmX6B3itlig77g4nAll++YroTn17uA/qqdNQ1I13XtdCI7G9yHxNs7w 20C9ZSEdkAt189BPCEsFYhReZkp1JZXmqP3I+y988kDWobVeIcWRfO0c6WBYxyxyXist 7CS/x+0nsCoCyigZSUB8UJL1CRiF8OEwAd3z5wP+sDzjMW4g36QcCNpDcnKnOL+fuwaX yvBQTYy8T6AuiJHkl6X8AYHIs56DCj+b2Srx+puJxJT7UvfjPPf7oee9YA+eS3vfqNvX 0VeA== MIME-Version: 1.0 X-Received: by 10.180.90.19 with SMTP id bs19mr1302582wib.15.1379657257634; Thu, 19 Sep 2013 23:07:37 -0700 (PDT) Received: by 10.216.58.196 with HTTP; Thu, 19 Sep 2013 23:07:37 -0700 (PDT) Date: Fri, 20 Sep 2013 15:07:37 +0900 Message-ID: Subject: select count query not working at cassandra 2.0.0 From: Katsutoshi To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=f46d043c80eac0d8e704e6ca7cf2 X-Virus-Checked: Checked by ClamAV on apache.org --f46d043c80eac0d8e704e6ca7cf2 Content-Type: text/plain; charset=ISO-8859-1 I would like to use select count query. Although it was work at Cassandra 1.2.9, but there is a situation which does not work at Cassandra 2.0.0. so, If some row is deleted, 'select count query' seems to return the wrong value. Did anything change by Cassandra 2.0.0 ? or Have I made a mistake ? My test procedure is as follows: ### At Cassandra 1.2.9 1) create table, and insert two rows ``` cqlsh:test> CREATE TABLE count_hash_test (key text, value text, PRIMARY KEY (key)); cqlsh:test> INSERT INTO count_hash_test (key, value) VALUES ('key1', 'value'); cqlsh:test> INSERT INTO count_hash_test (key, value) VALUES ('key2', 'value'); ``` 2) do a select count query, it returns 2 which is expected ``` cqlsh:test> SELECT * FROM count_hash_test; key | value ------+------- key1 | value key2 | value cqlsh:test> SELECT COUNT(*) FROM count_hash_test; count ------- 2 ``` 3) delete one row ``` cqlsh:test> DELETE FROM count_hash_test WHERE key='key1'; ``` 4) do a select count query, it returns 1 which is expected ``` cqlsh:test> SELECT * FROM count_hash_test; key | value ------+------- key2 | value cqlsh:test> SELECT COUNT(*) FROM count_hash_test; count ------- 1 ``` ### At Cassandra 2.0.0 1) create table, and insert two rows ``` cqlsh:test> CREATE TABLE count_hash_test (key text, value text, PRIMARY KEY (key)); cqlsh:test> INSERT INTO count_hash_test (key, value) VALUES ('key1', 'value'); cqlsh:test> INSERT INTO count_hash_test (key, value) VALUES ('key2', 'value'); ``` 2) do a select count query, it returns 2 which is expected ``` cqlsh:test> SELECT * FROM count_hash_test; key | value ------+------- key1 | value key2 | value cqlsh:test> SELECT COUNT(*) FROM count_hash_test; count ------- 2 ``` 3) delete one row ``` cqlsh:test> DELETE FROM count_hash_test WHERE key='key1'; ``` 4) do a select count query, but it returns 0 which is NOT expected ``` cqlsh:test> SELECT * FROM count_hash_test; key | value ------+------- key2 | value cqlsh:test> SELECT COUNT(*) FROM count_hash_test; count ------- 0 ``` Could anyone help me for this? thanks. Katsutoshi --f46d043c80eac0d8e704e6ca7cf2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I would like to use select count query.
Although it was= work at Cassandra 1.2.9, but there is a situation which does not work at C= assandra 2.0.0.
so, If some row is deleted, 'select count query'= ; seems to return the wrong value.
Did anything change by Cassandra 2.0.0 ? or Have I made a mistake ?
My test procedure is as follows:

### At Cassandra 1.2.9

1) c= reate table, and insert two rows

```
cqlsh:test> CREATE TABLE = count_hash_test (key text, value text, PRIMARY KEY (key));
cqlsh:test> INSERT INTO count_hash_test (key, value) VALUES ('key1&#= 39;, 'value');
cqlsh:test> INSERT INTO count_hash_test (key, = value) VALUES ('key2', 'value');
```

2) do a sele= ct count query, it returns 2 which is expected

```
cqlsh:test> SELECT * FROM count_hash_test;

=A0key=A0 |= value
------+-------
=A0key1 | value
=A0key2 | value

cqlsh= :test> SELECT COUNT(*) FROM count_hash_test;

=A0count
-------<= br>=A0=A0=A0=A0 2
```

3) delete one row

```
cqlsh:test> DELETE FROM count= _hash_test WHERE key=3D'key1';
```

4) do a select count q= uery, it returns 1 which is expected

```
cqlsh:test> SELECT * = FROM count_hash_test;

=A0key=A0 | value
------+-------
=A0key2 | value

cqlsh:tes= t> SELECT COUNT(*) FROM count_hash_test;

=A0count
-------
= =A0=A0=A0=A0 1
```

### At Cassandra 2.0.0

1) create table,= and insert two rows

```
cqlsh:test> CREATE TABLE count_hash_test (key text, value tex= t, PRIMARY KEY (key));
cqlsh:test> INSERT INTO count_hash_test (key, = value) VALUES ('key1', 'value');
cqlsh:test> INSERT I= NTO count_hash_test (key, value) VALUES ('key2', 'value');<= br> ```

2) do a select count query, it returns 2=A0 which is expected
```
cqlsh:test> SELECT * FROM count_hash_test;

=A0key=A0 = | value
------+-------
=A0key1 | value
=A0key2 | value

cqls= h:test> SELECT COUNT(*) FROM count_hash_test;

=A0count
-------
=A0=A0=A0=A0 2
```

3) delete one row
```
cqlsh:test> DELETE FROM count_hash_test WHERE key=3D'ke= y1';
```

4) do a select count query, but it returns 0 which i= s NOT expected

```
cqlsh:test> SELECT * FROM count_hash_test;

=A0key=A0 |= value
------+-------
=A0key2 | value

cqlsh:test> SELECT CO= UNT(*) FROM count_hash_test;

=A0count
-------
=A0=A0=A0=A0 0```

Could anyone help me for this? thanks.

Katsutoshi
--f46d043c80eac0d8e704e6ca7cf2--