OrderPreservingPartitioner and compound partition key

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

OrderPreservingPartitioner and compound partition key

Serega Sheypak
Hi imagine I have a table "events"
with fields:
ymd int
user_id uuid
ts timestamp
attr_1
attr_2

with primary key ((ymd, user_id, ts))
and I set OrderPreservingPartitioner as a partitioner for the table

ymd is int representation for the day: 20150410, 20150411, e.t.c.

Can I select from table using just ymd field?

select * from events
where ymd = 20150410




Reply | Threaded
Open this post in threaded view
|

Re: OrderPreservingPartitioner and compound partition key

Robert Coli-3
On Wed, Apr 8, 2015 at 1:27 AM, Serega Sheypak <[hidden email]> wrote:
and I set OrderPreservingPartitioner as a partitioner for the table

As a general statement, you almost certainly do not want to use the OrderPreservingPartitioner for any purpose.

It should probably be called the DontUseThisIfYouWantMostOfTheAdvantagesOfADistributedSystemPartitioner.

=Rob
 
Reply | Threaded
Open this post in threaded view
|

Re: OrderPreservingPartitioner and compound partition key

Serega Sheypak
I understand the reason, but If I user OrderPreservingPartitioner and have compound partition key, can I use select using only FIRST component of compound partition key?

2015-04-08 20:43 GMT+02:00 Robert Coli <[hidden email]>:
On Wed, Apr 8, 2015 at 1:27 AM, Serega Sheypak <[hidden email]> wrote:
and I set OrderPreservingPartitioner as a partitioner for the table

As a general statement, you almost certainly do not want to use the OrderPreservingPartitioner for any purpose.

It should probably be called the DontUseThisIfYouWantMostOfTheAdvantagesOfADistributedSystemPartitioner.

=Rob