Re: CQL Select Map using an IN relationship

2014-03-14 Thread David Savage
Hi Michael, Thanks for the feedback, all makes sense. If anyone wants me to raise a jira ticket for docs on (key1, key2) vs ((key1,key2)) and their implications, or fixing that if block in SelectStatement, let me know - though for the if block possibly best if that jira is raised by a C* expert s

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Laing, Michael
These are my personal opinions, reflecting both my long experience w database systems, and my newness to Cassandra... [tl;dr] The Cassandra contributors, having made its history, tend to describe it in terms of implementation rather than action. And its implementation has a history, all relativel

Re: CQL Select Map using an IN relationship

2014-03-13 Thread David Savage
be in the same partition or > distributed. > > -- Jack Krupansky > > *From:* Laing, Michael > *Sent:* Thursday, March 13, 2014 1:39 PM > *To:* user@cassandra.apache.org > *Subject:* Re: CQL Select Map using an IN relationship > > Think of them as: > > >

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Laing, Michael
13, 2014 1:39 PM > *To:* user@cassandra.apache.org > *Subject:* Re: CQL Select Map using an IN relationship > > Think of them as: > > > PRIMARY KEY (partition_key[, range_key]) > > > where the partition_key can be compounded as: > > > (partition_key0 [, partit

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Jack Krupansky
. -- Jack Krupansky From: Laing, Michael Sent: Thursday, March 13, 2014 1:39 PM To: user@cassandra.apache.org Subject: Re: CQL Select Map using an IN relationship Think of them as: PRIMARY KEY (partition_key[, range_key]) where the partition_key can be compounded as: (partition_key0

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Laing, Michael
Think of them as: PRIMARY KEY (partition_key[, range_key]) where the partition_key can be compounded as: (partition_key0 [, partition_key1, ...]) and the optional range_key can be compounded as: range_key0 [, range_key1 ...] If you do this: PRIMARY KEY (key1, key2) - then key1 is the partitio

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Sylvain Lebresne
On Thu, Mar 13, 2014 at 12:12 PM, David Savage wrote: > Hi there, > > I'm experimenting using cassandra and have run across an error message > which I need a little more information on. > > The use case I'm experimenting with is a series of document updates > (documents being an arbitrary map of k

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Peter Lin
probably a good idea to open a jira ticket to explain this better in the docs. the downside of moving so fast is the docs often fall behind and users have to dig around to figure things out. not everyone wants to read the CQL3 antlr grammar to figure things out. On Thu, Mar 13, 2014 at 11:27 AM,

Re: CQL Select Map using an IN relationship

2014-03-13 Thread David Savage
Great that works, thx! I probably would have never found that... It now makes me wonder in general when to use PRIMARY KEY (key1, key2) or PRIMARY KEY ((key1, key2)), any examples would be welcome if you have the time. Kind regards, Dave On Thu, Mar 13, 2014 at 2:56 PM, Laing, Michael wrote:

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Laing, Michael
Create your table like this and it will work: CREATE TABLE test.documents (group text,id bigint,data map,PRIMARY KEY ((group, id))); The extra parens catenate 'group' and 'id' into the partition key - IN will work on the last component of a partition key. ml On Thu, Mar 13, 2014 at 10:40 AM, D

Re: CQL Select Map using an IN relationship

2014-03-13 Thread David Savage
Nope, upgraded to 2.0.5 and still get the same problem, I actually simplified the problem a little in my first post, there's a composite primary key involved as I need to partition ids into groups So the full CQL statements are: CREATE KEYSPACE test WITH replication = {'class':'SimpleStrategy', '

Re: CQL Select Map using an IN relationship

2014-03-13 Thread David Savage
Hmmm that maybe the problem, I'm currently testing with 2.0.2 which got dragged in by the cassandra unit library I'm using for testing [1] I will try to fix my build dependencies and retry, thx. /Dave [1] https://github.com/jsevellec/cassandra-unit On Thu, Mar 13, 2014 at 1:56 PM, Laing, Michae

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Laing, Michael
I have no problem doing this w 2.0.5 - what version of C* are you using? Or maybe I don't understand your data model... attach 'creates' if you don't mind. ml On Thu, Mar 13, 2014 at 9:24 AM, David Savage wrote: > Hi Peter, > > Thanks for the help, unfortunately I'm not sure that's the problem,

Re: CQL Select Map using an IN relationship

2014-03-13 Thread David Savage
Hi Peter, Thanks for the help, unfortunately I'm not sure that's the problem, the id is the primary key on the documents table and the timestamp is the primary key on the eventlog table Kind regards, Dave On Thursday, 13 March 2014, Peter Lin wrote: > > it's not clear to me if your "id" colu

Re: CQL Select Map using an IN relationship

2014-03-13 Thread Peter Lin
it's not clear to me if your "id" column is the KEY or just a regular column with secondary index. queries that have IN on non primary key columns isn't supported yet. not sure if that answers your question. On Thu, Mar 13, 2014 at 7:12 AM, David Savage wrote: > Hi there, > > I'm experimenting

CQL Select Map using an IN relationship

2014-03-13 Thread David Savage
Hi there, I'm experimenting using cassandra and have run across an error message which I need a little more information on. The use case I'm experimenting with is a series of document updates (documents being an arbitrary map of key value pairs), I would like to find the latest document updates a