You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Joseph Stein <cr...@gmail.com> on 2011/07/05 19:28:02 UTC

can't reproduce duplicate SELECT rows - CASSANDRA-2717

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>
*/