Skip to content
Advertisement

Get a BigInteger attribute from Cassandra ResultSet

I’m trying to get the number of key value pairs in a Cassandra column family. Following is the code I used.

JavaScript

But when I ran this code, I’m getting following exception.

JavaScript

According to datastax documentation (http://www.datastax.com/drivers/java/2.0/com/datastax/driver/core/Row.html) getVarint should return a BigInteger. So why I am getting a exception here? What an I doing wrong?

Advertisement

Answer

You can get value as a long, instead.

I couldn’t test it but could you try this:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement