[
https://issues.apache.org/jira/browse/THRIFT-4915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16985925#comment-16985925
]
Marcin Pajkowski commented on THRIFT-4915:
------------------------------------------
I've just noticed similar issue - but in my case Rust's lib is actually a
sender.
It seems that Rust uses big endian for encoding/decoding doubles. However,
mainstream libraries tend to use little endian.
Some examples:
* Python
** write double:
[https://github.com/apache/thrift/blob/master/lib/py/src/protocol/TCompactProtocol.py#L278]
** read double:
[https://github.com/apache/thrift/blob/master/lib/py/src/protocol/TCompactProtocol.py#L416]
* C++ (please also take a look at macros in TProtocol.h)
** write double:
[https://github.com/apache/thrift/blob/master/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc#L255]
** read double:
[https://github.com/apache/thrift/blob/master/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc#L655]
> Deserializing double into OrderedFloat always returns zero when using
> TCompactProtocol
> --------------------------------------------------------------------------------------
>
> Key: THRIFT-4915
> URL: https://issues.apache.org/jira/browse/THRIFT-4915
> Project: Thrift
> Issue Type: Bug
> Components: Rust - Library
> Affects Versions: 0.12.0
> Reporter: ziming.wu
> Priority: Major
>
> Client: Rust + Thrift 0.12.0
> Server: CPP + Thrift 0.9.3
> Protocol: TCompactProtocol
> Transport: TBufferedTransport
>
> I logged before cpp server response to rust client
>
> {code:java}
> "age=21.339611053466797"
> {code}
> but client recieved
>
>
>
> {code:java}
> age:
> Some(OrderedFloat(0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000409415354256))
> {code}
> This bug only happens when using TCompactProtocol.
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)