You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Ching-Cheng Chen <cc...@evidentsoftware.com> on 2010/11/11 14:04:00 UTC

Secondary index query return row should not return?

Not sure if this the intended behavior of the indexed query.

I created a column family and added index on column A,B,C.

Now I insert three rows.

row1 : A=123, B=456, C=789
row2 : A=123, C=789
row3 : A=123, B=789, C=789

Now if I perform an indexed query for A=123 and B=456, both row1 and row2
are returned.

Is this the expected behavior?  Since row2 doesn't have column B, I would
expect B=456 expression should return false.

I'm using cassandra-0.7.0-beta3 and hector-0.7.0-19_11042010

Regards,

Chen

Re: Secondary index query return row should not return?

Posted by Jonathan Ellis <jb...@gmail.com>.
https://issues.apache.org/jira/browse/CASSANDRA-1745

On Thu, Nov 11, 2010 at 2:49 PM, Jonathan Ellis <jb...@gmail.com> wrote:
> It's working as written, but I think you're right that it makes more
> sense to fail the expression when the column doesn't exist.
>
> On Thu, Nov 11, 2010 at 7:04 AM, Ching-Cheng Chen
> <cc...@evidentsoftware.com> wrote:
>> Not sure if this the intended behavior of the indexed query.
>>
>> I created a column family and added index on column A,B,C.
>>
>> Now I insert three rows.
>>
>> row1 : A=123, B=456, C=789
>> row2 : A=123, C=789
>> row3 : A=123, B=789, C=789
>>
>> Now if I perform an indexed query for A=123 and B=456, both row1 and row2
>> are returned.
>>
>> Is this the expected behavior?  Since row2 doesn't have column B, I would
>> expect B=456 expression should return false.
>>
>> I'm using cassandra-0.7.0-beta3 and hector-0.7.0-19_11042010
>>
>> Regards,
>>
>> Chen
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Re: Secondary index query return row should not return?

Posted by Jonathan Ellis <jb...@gmail.com>.
It's working as written, but I think you're right that it makes more
sense to fail the expression when the column doesn't exist.

On Thu, Nov 11, 2010 at 7:04 AM, Ching-Cheng Chen
<cc...@evidentsoftware.com> wrote:
> Not sure if this the intended behavior of the indexed query.
>
> I created a column family and added index on column A,B,C.
>
> Now I insert three rows.
>
> row1 : A=123, B=456, C=789
> row2 : A=123, C=789
> row3 : A=123, B=789, C=789
>
> Now if I perform an indexed query for A=123 and B=456, both row1 and row2
> are returned.
>
> Is this the expected behavior?  Since row2 doesn't have column B, I would
> expect B=456 expression should return false.
>
> I'm using cassandra-0.7.0-beta3 and hector-0.7.0-19_11042010
>
> Regards,
>
> Chen



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Re: Secondary index query return row should not return?

Posted by Aaron Morton <aa...@thelastpickle.com>.
My understanding is the clauses are AND'd together. 

There is some nice logging from the ColumnFamilyStore when it's running the request, can you turn the logging up to DEBUG and send them along? 

The first log message will say something like "Primary scan clause is.." 

Cheers
Aaron

On 12 Nov, 2010,at 02:04 AM, Ching-Cheng Chen <cc...@evidentsoftware.com> wrote:

Not sure if this the intended behavior of the indexed query. 

I created a column family and added index on column A,B,C. 

Now I insert three rows. 

row1 : A=123, B=456, C=789 
row2 : A=123, C=789 
row3 : A=123, B=789, C=789 

Now if I perform an indexed query for A=123 and B=456, both row1 and row2 are returned. 

Is this the expected behavior?  Since row2 doesn't have column B, I would expect B=456 expression should return false.   

I'm using cassandra-0.7.0-beta3 and hector-0.7.0-19_11042010 

Regards, 

Chen