2
votes

I want to retrieve a row from Cassandra using column family and row key. However when I using SliceQuery, there is an exception:Caused by: me.prettyprint.hector.api.exceptions.HectorException: Neither column names nor range were set, this is an invalid slice predicate.

Does anyone know whether I have used a wrong Query implementation?

1
It will probably help if you paste the relevant section of your code.the paul

1 Answers

1
votes

This will give you an entire row:

SliceQuery query = HFactory.createSliceQuery(_keyspace, _stringSerializer, _stringSerializer, _stringSerializer);
query.setColumnFamily(columnFamily)
     .setKey(key)
     .setRange("", "", false, Integer.MAX_VALUE);