Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

using getcount() showing "predicate column_names and slice_range may not both be null" #14

Open
durgadevi4887 opened this Issue Mar 1, 2011 · 1 comment

Comments

Projects
None yet
2 participants

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 Apr 19, 2011

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment