using getcount() showing "predicate column_names and slice_range may not both be null"
Opened this issue · 1 comments
durgadevi4887 commented
Hi,
While using a getcount(key,columnparent,slicepredicate);
Here key as:
"my_key" and
Columnparent and columnpath as:
org::apache::cassandra::ColumnPath cp;
cp.__isset.column = true;
cp.column_family.assign("DynamicCF");
cp.column.assign("ColumnEg");
org::apache::cassandra::ColumnParent columnparent;
columnparent.column_family.assign("DynamicCF");
SlicePredicate as:
org::apache::cassandra::SlicePredicate slicepredicate;
org::apache::cassandra::SliceRange slicerange;
slicerange.start="";
slicerange.finish="";
slicepredicate.slice_range=slicerange;
org::apache::cassandra::KeyRange keyrange;
keyrange.start_key="my_key";
keyrange.end_key="my_key";
The function client->getCount("my_key",columnparent,slicepredicate); showing "predicate column_names and slice_range may not both be null".Already I assigned the column name to columnparent and passed the columnparent to getcount().How to add columnnames and slice range to predicate?
gnobal commented
I think you forgot to set the __isset.slice_range member of slicepredicate to true, so you're missing the line:
slicepredicate.__isset.slice_range = true;
Not entirely sure, though