incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anurag Gujral <anurag.guj...@gmail.com>
Subject Re: InvalidRequestException: Mutation must have one ColumnOrSuperColumn or one Deletion
Date Thu, 17 Mar 2011 16:29:17 GMT
Thanks for the reply. I added mutation.__isset.column_or_supercolumn=true;

Now I am getting TApplicationException: Internal error processing
batch_mutate

Any suggestions?
Thanks
Anurag

On Thu, Mar 17, 2011 at 8:13 AM, Anurag Gujral <anurag.gujral@gmail.com>wrote:

> Hi All,
>           I am using function batch_mutate of cassandra 0.7 and I am
> getting the error InvalidRequestException: Mutation must have one
> ColumnOrSuperColumn or one Deletion. I have my own C++ cassandra client
> using thrift 0.0.5 api.
>
> Any Suggestions.
>
> Sample Code
>     map<string, vector<Mutation> > cfmap;
>
>     vector<Mutation> mutations;
>
>        Column temp_col;
>         temp_col.name.assign("abcd");
>         temp_col.value.assign("efgh");
>         temp_col.timestamp = timestamp;
>         temp_col.ttl = 0; // TODO: TTL
>         ColumnOrSuperColumn cosc;
>         cosc.column = temp_col;
>         cosc.__isset.column = true; // must set which data type, col or
> super
>
>         Mutation mutation ;
>         mutation.column_or_supercolumn=cosc;
>         mutations.push_back(mutation);
>
>        cfmap.insert(make_pair(colspace, mutations));
>     map<string, map<string, vector<Mutation> > > mutationMap;
>     mutationMap.insert(make_pair("firstRow",cfmap))
>
> conn->client->batch_mutate(
>             mutationMap,
> (org::apache::cassandra::ConsistencyLevel::type)cons);
>
>
> Thanks
> Anurag
>

Mime
View raw message