Hi All, This is possible with cassandra-driver-core-2.1.5, with 'row.getLong("sum")'.
Thanks On Fri, Mar 27, 2015 at 2:51 PM, Amila Paranawithana <amila1...@gmail.com> wrote: > in Apache Cassandra Java Driver 2.1 how to read counter type values from a > row when iterating over result set. > > eg: If I have a counter table called 'countertable' with key and a counter > colum 'sum' how can I read the value of the counter column using Java > driver? > If I say, row.getInt("sum") this gives the following error, > > com.datastax.driver.core.exceptions.InvalidTypeException: Value sum is of > type counter > > Code :: > > ResultSet results = session.execute("SELECT * FROM simplex.countertable ") > > for (Row row : results) { > System.out.println(row.getString("key"),row.getInt("sum"))); > } > > Thanks, > Amila > > > -- > > *Amila Iroshani Paranawithana , **Senior Software Engineer* *, > AdroitLogic <http://adroitlogic.org>* > | ☎: +94779747398 > | ✍: http://amilaparanawithana.blogspot.com > [image: Facebook] <https://www.facebook.com/amila.paranawithana> [image: > Twitter] <https://twitter.com/AmilaPara> [image: LinkedIn] > <http://www.linkedin.com/profile/view?id=66289851&trk=tab_pro> [image: > Skype] amila.paranawithana > > -- *Amila Iroshani Paranawithana , **Senior Software Engineer* *, AdroitLogic <http://adroitlogic.org>* | ☎: +94779747398 | ✍: http://amilaparanawithana.blogspot.com [image: Facebook] <https://www.facebook.com/amila.paranawithana> [image: Twitter] <https://twitter.com/AmilaPara> [image: LinkedIn] <http://www.linkedin.com/profile/view?id=66289851&trk=tab_pro> [image: Skype] amila.paranawithana