Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 71030 invoked from network); 30 Apr 2010 17:26:07 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Apr 2010 17:26:07 -0000 Received: (qmail 94242 invoked by uid 500); 30 Apr 2010 17:26:06 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 94217 invoked by uid 500); 30 Apr 2010 17:26:06 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 94201 invoked by uid 99); 30 Apr 2010 17:26:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Apr 2010 17:26:06 +0000 X-ASF-Spam-Status: No, hits=-0.2 required=10.0 tests=AWL,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jbellis@gmail.com designates 74.125.82.172 as permitted sender) Received: from [74.125.82.172] (HELO mail-wy0-f172.google.com) (74.125.82.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Apr 2010 17:26:01 +0000 Received: by wyb35 with SMTP id 35so346987wyb.31 for ; Fri, 30 Apr 2010 10:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=CAwYlrrmdhLRClYitJcgI9tLv9QAtg7Abr8yAPMqdz4=; b=Jyi+Zay4NNkSx9Y8xieDgrFfO8Bh/u7HqHYghh+VQcd7mx/QhG+zIkN04DCguNkB84 rkh7KENaIGijLJLNQTwwg4QHHF0xSguFx8KxkITlVWWic9mD+2w70wswNy/uq+1xxJ2B Dw4lLBNRTwHta9ouZU9NH7KTjfrwzORjpQB3c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=NopfX3jzL8crF+FSjhX992uBT/0qqqwIht4cKe9FuhKVu3lt+0CT+F1QF89UXZee1m HVYMRUb/SuDBSPQqGwaq5Vy/WziwN7MCHnXqQcHBH1FH70HnmEhYkbzr+CZoJ1eqT2Lm SRx4PQ2VLsFg9oYVFN+4UVFOjcl04ojW9HeAk= Received: by 10.216.160.12 with SMTP id t12mr7419721wek.154.1272648339577; Fri, 30 Apr 2010 10:25:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.22.10 with HTTP; Fri, 30 Apr 2010 10:25:19 -0700 (PDT) In-Reply-To: References: From: Jonathan Ellis Date: Fri, 30 Apr 2010 12:25:19 -0500 Message-ID: Subject: Re: Batch mutate doesn't work To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable like I told you on the other list, erlang or the erlang thrift compiler is not exposing the error the cassandra server is sending you. "bad_return_value" is not it. Unless someone with actual erlang experience chimes in here, I would suggest trying with Python first, at least that will show you the real error. Then you can port back to erlang if you want. On Fri, Apr 30, 2010 at 8:58 AM, Zubair Quraishi 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 > > =A0{ok, C} =3D thrift_client:start_link("127.0.0.1",9160, cassandra_thrif= t), > > =A0Key =3D "Key1", > > =A0% > =A0% set first property > =A0% > =A0thrift_client:call( C, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'insert', > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0[ "Keyspace1", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Key, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#columnPath{column_family=3D"KeyVa= lue", column=3D"value"}, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"value1", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A01, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A01 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0] ), > > =A0% > =A0% set second property ( fails! - why? ) > =A0% > =A0MutationMap =3D > =A0{ > =A0 Key, > =A0 { > =A0 =A0 <<"KeyValue">>, > =A0 =A0 [ > =A0 =A0 =A0 #mutation{ > =A0 =A0 =A0 =A0 column_or_supercolumn =3D #column{ name =3D "property" , = value =3D > "value" , timestamp =3D 2 } > =A0 =A0 =A0 } > =A0 =A0 ] > =A0 } > =A0}, > =A0thrift_client:call( C, > =A0 'batch_mutate', > =A0 [ "Keyspace1", > =A0 =A0 =A0MutationMap, > =A0 =A0 =A01 > =A0 ] ) > > : The error returned is : > > ** exception exit: {bad_return_value,{error,{function_clause,[{dict,size, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 [{"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}]}}} > 7> > =3DERROR REPORT=3D=3D=3D=3D 30-Apr-2010::15:13:42 =3D=3D=3D > ** Generic server <0.55.0> terminating > ** Last message in was {call,batch_mutate, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0["Keyspace1", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 {"Key1", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{<<"KeyValue">>, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 [{mutation, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{colum= n,"property","value",2}, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0undefi= ned}]}}, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 1]} > ** When Server state =3D=3D {state,cassandra_thrift, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{protocol,thrift_binary_pr= otocol, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 {binary_protocol, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{transport,thrift_buff= ered_transport,<0.58.0>}, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0true,true}}, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A00} > ** Reason for termination =3D=3D > ** {bad_return_value, > =A0 =A0 =A0{error, > =A0 =A0 =A0 =A0 =A0{function_clause, > =A0 =A0 =A0 =A0 =A0 =A0 =A0[{dict,size, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 [{"Key1", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 {<<"KeyValue">>, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0[{mutation, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 {column,"property","v= alue",2}, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 undefined}]}}]}, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 {thrift_protocol,write,2}, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 {thrift_protocol,struct_write_loop,3}, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 {thrift_protocol,write,2}, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 {thrift_client,send_function_call,3}, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 {thrift_client,'-handle_call/3-fun-0-',3}, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 {thrift_client,catch_function_exceptions,2}, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 {thrift_client,handle_call,3}]}}} > --=20 Jonathan Ellis Project Chair, Apache Cassandra co-founder of Riptano, the source for professional Cassandra support http://riptano.com