incubator-cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Stein <crypt...@gmail.com>
Subject can't reproduce duplicate SELECT rows - CASSANDRA-2717
Date Tue, 05 Jul 2011 17:28:02 GMT
I tried to reproduce
https://issues.apache.org/jira/browse/CASSANDRA-2717but not able to :(
maybe already fixed from side affect change? =8^|

It was my first time ever using CQL (took a few minutes to figure it out to
download drivers as the way to access cqlsh>) so maybe I am just doing
something wrong.

cqlsh> CREATE KEYSPACE test with strategy_class = 'SimpleStrategy' and
strategy_options:replication_factor=1;
cqlsh> use test;
cqlsh> CREATE COLUMNFAMILY users (
   ... key varchar PRIMARY KEY,
   ... full_name varchar,
   ... birth_date int,
   ... state varchar
   ... );
cqlsh> CREATE INDEX ON users (birth_date);
cqlsh> CREATE INDEX ON users (state);
cqlsh> INSERT INTO users (key, full_name, birth_date, state) VALUES
('bsanderson', 'Brandon Sanderson', 1975, 'UT');
cqlsh> INSERT INTO users (key, full_name, birth_date, state) VALUES
('prothfuss', 'Patrick Rothfuss', 1973, 'WI');
cqlsh> INSERT INTO users (key, full_name, birth_date, state) VALUES
('htayler', 'Howard Tayler', 1968, 'UT');
cqlsh> SELECT key, state FROM users;
        key | state |
 bsanderson |    UT |
  prothfuss |    WI |
    htayler |    UT |

cqlsh> SELECT key, state FROM users where key = 'htayler';
     key | state |
 htayler |    UT |

cqlsh> SELECT key, state FROM users where key = 'htayler' and key =
'htayler';
Bad Request: SELECTs can contain only by by-key clause


============> not sure why this is erroring..... I was expecting 2 results
like the ticket said

cqlsh> SELECT key, state FROM users where state = 'UT';
        key | state |
 bsanderson |    UT |
    htayler |    UT |

cqlsh> SELECT key, state FROM users where state = 'UT' and state = 'UT';
        key | state |
 bsanderson |    UT |
    htayler |    UT |

============> I kind of expected this to give me 2 rows back also

cqlsh> SELECT key, state FROM users where state = 'UT' and state ='WI';
cqlsh>

============> no rows as expected

/*
Joe Stein
http://www.linkedin.com/in/charmalloc
Twitter: @allthingshadoop <http://www.twitter.com/allthingshadoop>
*/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message