Cassandra 1.2

2013-01-05 Thread Kais Ahmed
Hi all,

I create a table in cassandra 1.2, and makes two queries, the second
query gives
me a false result, is this normal behavior?


--
[cqlsh 2.3.0 | Cassandra 1.2.0-SNAPSHOT | CQL spec 3.0.0 | Thrift protocol
19.35.0]

cqlsh:test> CREATE TABLE foo (   a int,   b text,   c uuid,   PRIMARY KEY
((a, b)) );

cqlsh:test> INSERT INTO foo (a, b , c ) VALUES (  1 , 'aze',
'4d481800-4c5f-11e1-82e0-3f484de45426');
cqlsh:test> INSERT INTO foo (a, b , c ) VALUES (  1 , 'ert',
'693f5800-8acb-11e3-82e0-3f484de45426');
cqlsh:test> INSERT INTO foo (a, b , c ) VALUES (  1 , 'opl',
'd4815800-2d8d-11e0-82e0-3f484de45426');

-

cqlsh:test> SELECT * FROM foo;

 a | b   | c
---+-+--
 1 | ert | 693f5800-8acb-11e3-82e0-3f484de45426
 1 | opl | d4815800-2d8d-11e0-82e0-3f484de45426
 1 | aze | 4d481800-4c5f-11e1-82e0-3f484de45426

-

cqlsh:test> SELECT * FROM foo where a=1;

 a | b   | c
---+-+--
 1 | ert | 693f5800-8acb-11e3-82e0-3f484de45426
 1 | opl | d4815800-2d8d-11e0-82e0-3f484de45426


RE: Cassandra 1.2

2013-01-05 Thread Pierre Chalamet
Hello,

Removing the extra parenthesis around the primary key definition seems to
work as expected:
CREATE TABLE foo2 (a int, b text, c uuid,   PRIMARY KEY (a, b) );
INSERT INTO foo2 (a, b , c ) VALUES (  1 , 'aze',
'4d481800-4c5f-11e1-82e0-3f484de45426');
INSERT INTO foo2 (a, b , c ) VALUES (  1 , 'ert',
'693f5800-8acb-11e3-82e0-3f484de45426');
INSERT INTO foo2 (a, b , c ) VALUES (  1 , 'opl',
'd4815800-2d8d-11e0-82e0-3f484de45426');

localhost> select * from foo where a=1;
+---+-+--+
| a | b   | c|
+===+=+==+
| 1 | ert | 693f5800-8acb-11e3-82e0-3f484de45426 |
+---+-+--+
| 1 | opl | d4815800-2d8d-11e0-82e0-3f484de45426 |
+---+-+--+

localhost> select * from foo2 where a=1;
+---+-+--+
| a | b   | c|
+===+=+==+
| 1 | aze | 4d481800-4c5f-11e1-82e0-3f484de45426 |
+---+-+--+
| 1 | ert | 693f5800-8acb-11e3-82e0-3f484de45426 |
+---+-+--+
| 1 | opl | d4815800-2d8d-11e0-82e0-3f484de45426 |
+---+-+--+

Looks like there is something weird happening when creating the table.

- Pierre

-Original Message-
From: Kais Ahmed [mailto:k...@neteck-fr.com] 
Sent: Saturday, January 05, 2013 2:30 PM
To: dev@cassandra.apache.org
Subject: Cassandra 1.2

Hi all,

I create a table in cassandra 1.2, and makes two queries, the second query
gives me a false result, is this normal behavior?



--
[cqlsh 2.3.0 | Cassandra 1.2.0-SNAPSHOT | CQL spec 3.0.0 | Thrift protocol
19.35.0]

cqlsh:test> CREATE TABLE foo (   a int,   b text,   c uuid,   PRIMARY KEY
((a, b)) );

cqlsh:test> INSERT INTO foo (a, b , c ) VALUES (  1 , 'aze',
'4d481800-4c5f-11e1-82e0-3f484de45426');
cqlsh:test> INSERT INTO foo (a, b , c ) VALUES (  1 , 'ert',
'693f5800-8acb-11e3-82e0-3f484de45426');
cqlsh:test> INSERT INTO foo (a, b , c ) VALUES (  1 , 'opl',
'd4815800-2d8d-11e0-82e0-3f484de45426');


-

cqlsh:test> SELECT * FROM foo;

 a | b   | c
---+-+--
 1 | ert | 693f5800-8acb-11e3-82e0-3f484de45426
 1 | opl | d4815800-2d8d-11e0-82e0-3f484de45426
 1 | aze | 4d481800-4c5f-11e1-82e0-3f484de45426


-

cqlsh:test> SELECT * FROM foo where a=1;

 a | b   | c
---+-+--
 1 | ert | 693f5800-8acb-11e3-82e0-3f484de45426
 1 | opl | d4815800-2d8d-11e0-82e0-3f484de45426



Re: Cassandra 1.2

2013-01-05 Thread Dave Brosius

probably a good idea to put the original issue on jire, anyway.

https://issues.apache.org/jira/browse/CASSANDRA



On 01/05/2013 11:16 AM, Pierre Chalamet wrote:

Hello,

Removing the extra parenthesis around the primary key definition seems to
work as expected:
CREATE TABLE foo2 (a int, b text, c uuid,   PRIMARY KEY (a, b) );
INSERT INTO foo2 (a, b , c ) VALUES (  1 , 'aze',
'4d481800-4c5f-11e1-82e0-3f484de45426');
INSERT INTO foo2 (a, b , c ) VALUES (  1 , 'ert',
'693f5800-8acb-11e3-82e0-3f484de45426');
INSERT INTO foo2 (a, b , c ) VALUES (  1 , 'opl',
'd4815800-2d8d-11e0-82e0-3f484de45426');

localhost> select * from foo where a=1;
+---+-+--+
| a | b   | c|
+===+=+==+
| 1 | ert | 693f5800-8acb-11e3-82e0-3f484de45426 |
+---+-+--+
| 1 | opl | d4815800-2d8d-11e0-82e0-3f484de45426 |
+---+-+--+

localhost> select * from foo2 where a=1;
+---+-+--+
| a | b   | c|
+===+=+==+
| 1 | aze | 4d481800-4c5f-11e1-82e0-3f484de45426 |
+---+-+--+
| 1 | ert | 693f5800-8acb-11e3-82e0-3f484de45426 |
+---+-+--+
| 1 | opl | d4815800-2d8d-11e0-82e0-3f484de45426 |
+---+-+--+

Looks like there is something weird happening when creating the table.

- Pierre

-Original Message-
From: Kais Ahmed [mailto:k...@neteck-fr.com]
Sent: Saturday, January 05, 2013 2:30 PM
To: dev@cassandra.apache.org
Subject: Cassandra 1.2

Hi all,

I create a table in cassandra 1.2, and makes two queries, the second query
gives me a false result, is this normal behavior?



--
[cqlsh 2.3.0 | Cassandra 1.2.0-SNAPSHOT | CQL spec 3.0.0 | Thrift protocol
19.35.0]

cqlsh:test> CREATE TABLE foo (   a int,   b text,   c uuid,   PRIMARY KEY
((a, b)) );

cqlsh:test> INSERT INTO foo (a, b , c ) VALUES (  1 , 'aze',
'4d481800-4c5f-11e1-82e0-3f484de45426');
cqlsh:test> INSERT INTO foo (a, b , c ) VALUES (  1 , 'ert',
'693f5800-8acb-11e3-82e0-3f484de45426');
cqlsh:test> INSERT INTO foo (a, b , c ) VALUES (  1 , 'opl',
'd4815800-2d8d-11e0-82e0-3f484de45426');


-

cqlsh:test> SELECT * FROM foo;

  a | b   | c
---+-+--
  1 | ert | 693f5800-8acb-11e3-82e0-3f484de45426
  1 | opl | d4815800-2d8d-11e0-82e0-3f484de45426
  1 | aze | 4d481800-4c5f-11e1-82e0-3f484de45426


-

cqlsh:test> SELECT * FROM foo where a=1;

  a | b   | c
---+-+--
  1 | ert | 693f5800-8acb-11e3-82e0-3f484de45426
  1 | opl | d4815800-2d8d-11e0-82e0-3f484de45426