incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaron morton <aa...@thelastpickle.com>
Subject Re: is the select result grouped by the value of the partition key?
Date Sun, 14 Apr 2013 17:54:18 GMT
> 
>>> Is it guaranteed that the rows are grouped by the value of the
>>> partition key? That is, is it guaranteed that I'll get
yes.


-----------------
Aaron Morton
Freelance Cassandra Consultant
New Zealand

@aaronmorton
http://www.thelastpickle.com

On 12/04/2013, at 7:24 PM, Sorin Manolache <sorinm@gmail.com> wrote:

> On 2013-04-11 22:10, aaron morton wrote:
>>> Is it guaranteed that the rows are grouped by the value of the
>>> partition key? That is, is it guaranteed that I'll get
>> Your primary key (k1, k2) is considered in type parts (partition_key ,
>> grouping_columns). In your case the primary_key is key and the grouping
>> column in k2. Columns are ordered by the grouping columns, k2.
>> 
>> See http://thelastpickle.com/2013/01/11/primary-keys-in-cql/
> 
> Thank you for the answer.
> 
> However my question was about the _grouping_ (not ordering) of _rows_ (not columns).
> 
> Sorin
> 
>> 
>> Cheers
>> 
>> -----------------
>> Aaron Morton
>> Freelance Cassandra Consultant
>> New Zealand
>> 
>> @aaronmorton
>> http://www.thelastpickle.com
>> 
>> On 12/04/2013, at 3:19 AM, Sorin Manolache <sorinm@gmail.com
>> <mailto:sorinm@gmail.com>> wrote:
>> 
>>> Hello,
>>> 
>>> Let us consider that we have a table t created as follows:
>>> 
>>> create table t(k1 vachar, k2 varchar, value varchar, primary key (k1,
>>> k2));
>>> 
>>> Its contents is
>>> 
>>> a m x
>>> a n y
>>> z 0 9
>>> z 1 8
>>> 
>>> and I perform a
>>> 
>>> select * from p where k1 in ('a', 'z');
>>> 
>>> Is it guaranteed that the rows are grouped by the value of the
>>> partition key? That is, is it guaranteed that I'll get
>>> 
>>> a m x
>>> a n y
>>> z 0 9
>>> z 1 8
>>> 
>>> or
>>> 
>>> a n y
>>> a m x
>>> z 1 8
>>> z 0 9
>>> 
>>> or even
>>> 
>>> z 0 9
>>> z 1 8
>>> a n y
>>> a m x
>>> 
>>> but NEVER
>>> 
>>> a m x
>>> z 0 9
>>> a n y
>>> z 1 8
>>> 
>>> 
>>> Thank you,
>>> Sorin
>> 
> 


Mime
View raw message