title: How to execute multiple queries in a single batch on Cassandra
body: <p>I have a Cassandra table as below:</p>
  
  <p><code>create table experience.userstats (stream varchar, user varchar, computer varchar, experience varchar, amount int, primary key (experience, stream, user, computer);</code></p>
  
  <p>I am using Apache storm bolts to create these records in Cassandra from a queue spout. </p>
  
  <p>I want to generate aggregate statistics and display the counter for different experiences for a given stream as a pie chart. For example, 30% satisfied, 40% mixed and 30% unsatisfied experience. </p>
  
  <p>Since I cannot update counters online, I am using a Clock spout (timer) to read this data and generate counters into a new table. But Cassandra does not support group by clauses and hence I have to read thrice to get the counter for each experience as below.</p>
  
  <pre><code>select count(*) from experience.userstats where experience='satisfied' and stream='xyz';
  
  select count(*) from experience.userstats where experience='unsatisfied' and stream='xyz';
  
  select count(*) from experience.userstats where experience='mixed' and stream='xyz';
  </code></pre>
  
  <p>The problem with this approach is that I have to execute three queries on database to get the counters for the 3 types of experience and experience could be modified in the mean-time making these counters inconsistent.</p>
  
  <p>Is there a way I can execute above three select statements in a single batch? Or could you please suggest an alternative design approach?</p>