Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra type error

Tags:

java

cassandra

    Row row = DataSession._getSession().execute("select count (*) from sivri_service.bronzelist").one();
    int expected = row.getVarint("count").intValue();

I am attempting to get the count from a table, but I cannot seem to get past this exception: com.datastax.driver.core.exceptions.InvalidTypeException: Column count is of type bigint

like image 833
david_jr Avatar asked Oct 14 '14 04:10

david_jr


1 Answers

"Column count is of type bigint"

Based on this chart which maps CQL3 data types to Java types, you'll want to get that value as a long, instead.

long expected = row.getLong("count");

Note: I am making a (educated) guess that you are using Java. Next time, please indicate this in your question to remove any doubt.

like image 102
Aaron Avatar answered Nov 04 '22 04:11

Aaron