Go through spark API documentation. Basically you have to do group by (date, message_type) and then do a count.
On Sun, Jan 4, 2015, 9:58 PM Dinesh Vallabhdas <dines...@yahoo.com.invalid> wrote: > A spark cassandra newbie question. Thanks in advance for the help. > I have a cassandra table with 2 columns message_timestamp(timestamp) and > message_type(text). The data is of the form > > 2014-06-25 12:01:39 "START" > 2014-06-25 12:02:39 "START" > 2014-06-25 12:02:39 "PAUSE" > 2014-06-25 14:02:39 "STOP" > 2014-06-25 15:02:39 "START" > 2014-06-27 12:01:39 "START" > 2014-06-27 11:03:39 "STOP" > 2014-06-27 12:03:39 "REWIND" > 2014-06-27 12:04:39 "RESTART" > 2014-06-27 12:05:39 "PAUSE" > 2014-06-27 13:03:39 "REWIND" > 2014-06-27 14:03:39 "START" > > I want to use spark(using java) to calculate counts of a message_type on a > per day basis and store it back in cassandra in a new table with 3 columns ( > date,message_type,count). > The result table should look like this > > 2014-06-25 START 3 > 2014-06-25 STOP 1 > 2014-06-25 PAUSE 1 > 2014-06-27 START 2 > 2014-06-27 STOP 1 > 2014-06-27 PAUSE 1 > 2014-06-27 REWIND 2 > 2014-06-27 RESTART 1 > > I'm not proficient in scala and would like to use java. > > >