You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Jeremy Hanna <je...@gmail.com> on 2011/07/02 16:40:57 UTC

ruby client struggling with UTF8 inserts?

A coworker of mine in the UK has been having problems with inserting UTF8 Strings into Cassandra using the Ruby thrift client.  I'm just wondering if anyone else is seeing this or if they have a workaround.

It may have to do with ruby/thrift itself: https://issues.apache.org/jira/browse/THRIFT-1224.  Looks like Bryan Duxbury has an idea of what might help at that level.

For informational purposes, I asked him what clients/gems he's tried and he sent the following.

We are using a bunch of gems. From high-level to low-level: cassandra 0.11.1 [1], thrift_client 0.6.2 [2], thrift 0.6.0 [3].

As you can see in the issue I linked above, I believe the problem to be in the ruby implementation of the thrift library.

Ruby 1.9 might have something to do with the issue (since in 1.9 character encoding is enforced more strictly).

[1] https://github.com/fauna/cassandra
[2] https://github.com/fauna/thrift_client
[3] http://rubygems.org/gems/thrift

Re: ruby client struggling with UTF8 inserts?

Posted by Jonathan Ellis <jb...@gmail.com>.
On Sat, Jul 2, 2011 at 9:40 AM, Jeremy Hanna <je...@gmail.com> wrote:
> It may have to do with ruby/thrift itself: https://issues.apache.org/jira/browse/THRIFT-1224.  Looks like Bryan Duxbury has an idea of what might help at that level.

That looks like a smoking gun, all right.

You can always use binary fields and manually encode/decode as a workaround.

(I know from experience[1] that some Thrift committers see
platform-dependent string behavior as a "feature.")

[1] https://issues.apache.org/jira/browse/THRIFT-395

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