Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用哪个查询实现从Cassandra获取行_Cassandra_Hector - Fatal编程技术网

使用哪个查询实现从Cassandra获取行

使用哪个查询实现从Cassandra获取行,cassandra,hector,Cassandra,Hector,我想使用列族和行键从Cassandra检索一行。 但是,当我使用SliceQuery时,出现了一个异常:由以下原因引起:me.prettyprint.hector.api.exceptions.hector异常:未设置列名或范围,这是一个无效的切片谓词 有人知道我是否使用了错误的查询实现吗?这将为您提供一整行: SliceQuery query = HFactory.createSliceQuery(_keyspace, _stringSerializer, _stringSerializer,

我想使用列族和行键从Cassandra检索一行。 但是,当我使用SliceQuery时,出现了一个异常:由以下原因引起:me.prettyprint.hector.api.exceptions.hector异常:未设置列名或范围,这是一个无效的切片谓词


有人知道我是否使用了错误的查询实现吗?

这将为您提供一整行:

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

如果粘贴代码的相关部分,可能会有所帮助。