[
https://issues.apache.org/jira/browse/THRIFT-1023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13273466#comment-13273466
]
Roger Meier commented on THRIFT-1023:
-------------------------------------
I have the following issue with your patch on debian using ruby 1.8 :
{noformat}
Thrift::Client should increment the sequence id when sending messages (it seems
sequence ids are completely ignored right now)
./spec/client_spec.rb:56
1)
NoMethodError in 'Thrift::BufferedTransport should buffer writes and send them
o n flush'
undefined method `force_encoding' for "one/":String
./spec/base_transport_spec.rb:95:
2)
NoMethodError in 'Thrift::BufferedTransport should only send buffered data once'
undefined method `force_encoding' for "one/":String
./spec/base_transport_spec.rb:106:
3)
NoMethodError in 'Thrift::HTTPClientTransport should post via HTTP and return
th e results'
undefined method `force_encoding' for "a test":String
./spec/http_client_spec.rb:37:
4)
NoMethodError in 'Thrift::HTTPClientTransport should send custom headers if
defi ned'
undefined method `force_encoding' for "test":String
./spec/http_client_spec.rb:50:
Finished in 3.558732 seconds
349 examples, 4 failures, 1 pending
rake aborted!
Command /usr/bin/ruby1.8 -I"lib" "/usr/bin/spec" "spec/base_protocol_spec.rb"
" spec/base_transport_spec.rb" "spec/binary_protocol_accelerated_spec.rb"
"spec/bi nary_protocol_spec.rb" "spec/client_spec.rb" "spec/exception_spec.rb"
"spec/mong rel_http_server_spec.rb" "spec/processor_spec.rb"
"spec/server_socket_spec.rb" " spec/struct_spec.rb" "spec/union_spec.rb"
"spec/socket_spec.rb" "spec/json_proto col_spec.rb"
"spec/struct_nested_containers_spec.rb" "spec/compact_protocol_spec .rb"
"spec/http_client_spec.rb" "spec/nonblocking_server_spec.rb" "spec/serializ
er_spec.rb" "spec/server_spec.rb" "spec/types_spec.rb"
"spec/unix_socket_spec.rb " --color failed
{noformat}
> Thrift encoding (UTF-8) issue with Ruby 1.9.2
> ----------------------------------------------
>
> Key: THRIFT-1023
> URL: https://issues.apache.org/jira/browse/THRIFT-1023
> Project: Thrift
> Issue Type: Bug
> Components: Ruby - Library
> Affects Versions: 0.5
> Environment: OSX, Ruby 1.9.2, Thrift Gem version 0.5.0
> Reporter: Vincent Peres
> Assignee: Jake Farrell
> Attachments: thrift-1023-utf8-encoding-issue.path
>
>
> I came up with an encoding issue coming from the Thrift library, and
> especially the BufferedTransport class.
> I've decided to write down few tests to give you a concrete example :
> # encoding: utf-8
> require 'spec_helper'
> describe "encoding" do
> before do
> transport =
> Thrift::BufferedTransport.new(Thrift::Socket.new(MR_CONFIG['host'], 9090))
> protocol = Thrift::BinaryProtocol.new(transport)
> @client = Apache::Hadoop::Hbase::Thrift::Hbase::Client.new(protocol)
> transport.open()
> @table_name = "encoding_test"
> @column_family = "info:"
> end
> it "should create a new table" do
> column = Apache::Hadoop::Hbase::Thrift::ColumnDescriptor.new{|c| c.name=
> @column_family}
> @client.createTable(@table_name, [column]).should be_nil
> end
> it "should save standard caracteres" do
> m = Apache::Hadoop::Hbase::Thrift::Mutation.new
> m.column = "info:first_name"
> m.value = "Vincent"
> m.value.encoding.should == Encoding::UTF_8
> @client.mutateRow(@table_name, "ID1", [m]).should be_nil
> end
> it "should save UTF8 caracteres" do
> m = Apache::Hadoop::Hbase::Thrift::Mutation.new
> m.column = "info:first_name"
> m.value = "Thorbjørn"
> m.value.encoding.should == Encoding::UTF_8
> @client.mutateRow(@table_name, "ID1", [m]).should be_nil
> end
> it "should destroy the table" do
> @client.disableTable(@table_name).should be_nil
> @client.deleteTable(@table_name).should be_nil
> end
> end
> It fails when it tries to save the UTF8 string including the caractere 'ø'.
> Here is the output :
> 1) encoding should save UTF8 caracteres
> Failure/Error: @client.mutateRow(@table_name, "ID1", [m]).should be_nil
> incompatible character encodings: ASCII-8BIT and UTF-8
>
> #/Users/vincentp/.rvm/gems/ruby-1.9.2-p0/gems/thrift-0.5.0/lib/thrift/transport/buffered_transport.rb:59:in
> `write'
>
> #/Users/vincentp/.rvm/gems/ruby-1.9.2-p0/gems/thrift-0.5.0/lib/thrift/protocol/binary_protocol.rb:107:in
> `write_string'
>
> #/Users/vincentp/.rvm/gems/ruby-1.9.2-p0/gems/thrift-0.5.0/lib/thrift/client.rb:35:in
> `write'
>
> #/Users/vincentp/.rvm/gems/ruby-1.9.2-p0/gems/thrift-0.5.0/lib/thrift/client.rb:35:in
> `send_message'
> # ./lib/thrift/hbase.rb:289:in `send_mutateRow'
> # ./lib/thrift/hbase.rb:284:in `mutateRow'
> # ./spec/thrift/cases/encoding_spec.rb:37:in `block (2 levels) in <top
> (required)>'
> Let me know if you need any other details, thank you !
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira