You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Peter Morris <mr...@gmail.com> on 2012/08/20 19:20:40 UTC

CQL results are confusing me

Consider the following statements

#1 New family is created so I have no data
create columnfamily Test (UserName varchar primary key, EmailAddress
varchar);

#2 Count how many rows I have
select count(1) from Test;
-Expected: 0
-Actual: 0

#3 Select all users with a specific email address
select * from Test where EmailAddress = 'x';
-Expected: Zero rows
-Actual: Bad Request: No indexed columns present in by-columns clause with
"equals" operator


#4 Select all users with a specific user name (primary key)
select * from Test where UserName = 'x';
-Expected: Zero rows
-Actual: 1 row with 1 column 'UserName' = 'x';


I am simply trying to determine if a user already exists with a specific
email address or with a specific user name.  Item #4 is the most confusing,
what is going on?

Re: CQL results are confusing me

Posted by Juan Ezquerro <ju...@sofistic.net>.
EmailAddress is not indexed, must declare key for this before can do a
search.

2012/8/20 Peter Morris <mr...@gmail.com>

> Consider the following statements
>
> #1 New family is created so I have no data
> create columnfamily Test (UserName varchar primary key, EmailAddress
> varchar);
>
> #2 Count how many rows I have
> select count(1) from Test;
> -Expected: 0
> -Actual: 0
>
> #3 Select all users with a specific email address
> select * from Test where EmailAddress = 'x';
> -Expected: Zero rows
> -Actual: Bad Request: No indexed columns present in by-columns clause with
> "equals" operator
>
>
> #4 Select all users with a specific user name (primary key)
> select * from Test where UserName = 'x';
> -Expected: Zero rows
> -Actual: 1 row with 1 column 'UserName' = 'x';
>
>
> I am simply trying to determine if a user already exists with a specific
> email address or with a specific user name.  Item #4 is the most confusing,
> what is going on?
>



-- 
Juan Ezquerro LLanes <Sofistic Team>

Telf: 618349107/964051479