I am using Erlang to interface with Cassandra and I cannot get the get_slice command to return a list of all the columns of a row. I use:
X = thrift_client:call( C,
'get_slice',
[ "Keyspace1",
K,
#columnParent{column_family="KeyValue"},
#slicePredicate{},
1
] ),
: but I get back :
invalidRequestException,<<"predicate column_names and slice_range may not both be null">>
: However, using the cassandra-cli interface this works fine. Any ideas?
Updated:
I amended the Erlang example to reflect the Java exmaple given to :
get_props(K) -> {ok, C} = thrift_client:start_link("127.0.0.1",9160, cassandra_thrift),
S = #sliceRange{start="",finish="",reversed=false,count=100},
X = thrift_client:call( C,
'get_slice',
[ "Keyspace1",
K,
#columnParent{column_family="KeyValue"},
#slicePredicate{slice_range=S},
1
] ),
X.
:and it now works. Notice the addition of the line:
S = #sliceRange{start="",finish="",reversed=false,count=100}