cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: Mutate function not working
Date Fri, 30 Apr 2010 13:21:31 GMT
You could try asking on the user@ list, but it looks like erlang is
eating an invalidrequestexception which is not very helpful.

On Fri, Apr 30, 2010 at 8:16 AM, Zubair Quraishi <zubairq@gmail.com> wrote:
> I have the following code in Erlang to set a value and then add a
> property. The first set works but the mutate fails. Can anyone
> enlighten me?
> Thanks
>
>  {ok, C} = thrift_client:start_link("127.0.0.1",9160, cassandra_thrift),
>
>  Key = "Key1",
>
>  %
>  % set first property
>  %
>  thrift_client:call( C,
>                   'insert',
>                   [ "Keyspace1",
>                     Key,
>                     #columnPath{column_family="KeyValue", column="value"},
>                     "value1",
>                     1,
>                     1
>                     ] ),
>
>  %
>  % set second property ( fails! - why? )
>  %
>  MutationMap =
>  {
>    Key,
>    {
>      <<"KeyValue">>,
>      [
>        #mutation{
>          column_or_supercolumn = #column{ name = "property" , value =
> "value" , timestamp = 2 }
>        }
>      ]
>    }
>  },
>  thrift_client:call( C,
>    'batch_mutate',
>    [ "Keyspace1",
>       MutationMap,
>       1
>    ] )
>
> : The error returned is :
>
> ** exception exit: {bad_return_value,{error,{function_clause,[{dict,size,
>                                                          
         [{"Key1",
>
> {<<"KeyValue">>,
>
> [{mutation,{column,"property","value",2},undefined}]}}]},
>
> {thrift_protocol,write,2},
>
> {thrift_protocol,struct_write_loop,3},
>
> {thrift_protocol,write,2},
>
> {thrift_client,send_function_call,3},
>
> {thrift_client,'-handle_call/3-fun-0-',3},
>
> {thrift_client,catch_function_exceptions,2},
>
> {thrift_client,handle_call,3}]}}}
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Mime
View raw message