With the release of Cassandra 2.2 and 3.0, we can now use User Defined Aggregates (UDA) to perform aggregation queries directly in Cassandra.
However, the current settings of read timeout (12 secs) as well as its global scope is not suitable for UDA. Indeed, 12 secs is a very large limit for real time OLTP queries but may not be sufficient enough for aggregation queries that need to fetch millions of rows server-side.
Most of the time, an aggregation query fails because the query duration exceeds the read timeout value.
Setting this timeout to a huge value like 200secs may not be a good decision for OLTP queries.
It will be easier if we can set the read timeout on the query level.
Resolution: added Statement.setReadTimeoutMillis