Or just: cli > create column family ride_events with comparator(Int32Type,Int32Type,Int32Type);
On Tue, May 28, 2013 at 4:45 AM, Tristan Seligmann <mithra...@mithrandi.net>wrote: > On Mon, May 27, 2013 at 11:38 PM, Matthew Hillsborough < > matthew.hillsboro...@gmail.com> wrote: > >> Originally what I thought of doing was creating a column family in >> Cassandra named `ride_events`. Each row key would be a rideID that's simply >> an integer. I would then arbitrarily create columns with a name of the >> following format: >> >> "EventID_5/Day_2/User_6" with a value of null. >> > > You can accomplish the same thing with a CQL 3 schema like this: > > CREATE TABLE ride_events ( > rideID int, > eventID int, > day int, > userID int, > dummy text, > PRIMARY KEY (rideID, eventID, day, userID)); > > (I'm not sure if the `dummy` column is still required, it was last time I > tried this). > > rideID will then be used as the partition key (underlying row key), while > eventID / day / userID will be composited into the underlying storage > engine column names. > > An example query against this schema might be: > > SELECT userID FROM ride_events WHERE rideID in (...) AND eventID = 5 AND > day = 2; > -- > mithrandi, i Ainil en-Balandor, a faer Ambar >