dav*_*_jr 9 java cassandra datastax
Row row = DataSession._getSession().execute("select count (*) from sivri_service.bronzelist").one();
int expected = row.getVarint("count").intValue();
Run Code Online (Sandbox Code Playgroud)
我试图从表中获取计数,但我似乎无法通过此异常:com.datastax.driver.core.exceptions.InvalidTypeException:列计数的类型为bigint
Aar*_*ron 14
"列数是bigint类型"
基于此图表将CQL3数据类型映射到Java类型,您将希望将该值作为a来获取long.
long expected = row.getLong("count");
Run Code Online (Sandbox Code Playgroud)
注意:我正在(有教养的)猜测您正在使用Java.下次,请在您的问题中注明这一点,以消除任何疑问.