[
https://issues.apache.org/jira/browse/THRIFT-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13895165#comment-13895165
]
Dan Small commented on THRIFT-2353:
-----------------------------------
Some observations :
- In a hex editor I noticed that one of the differences between the output of
the C++ and the Java samples was that the output from the C++ code contained
the sequence 0x0D 0X0A in several spots where the Java code's output only
contained 0x0A.
I updated TSimpleFileTransport.cpp to or in the flag _O_BINARY in the case
of _WIN32 and my 'No more data to read' error went away.
- While the above got rid of the error, the output from the Java and C++ code
still differed. The output from the Java code was 1750 bytes while the output
from the C++ code was 1816 bytes. Despite the size difference the each sample
seemed happy with the other's output. ( No read error, equality test between
test object and sample read from disk passed, dump fields that had been set
showed all fields contained the expected values. )
> Unexpected 'No more data to read.' when using TCompactProtocolT
> ---------------------------------------------------------------
>
> Key: THRIFT-2353
> URL: https://issues.apache.org/jira/browse/THRIFT-2353
> Project: Thrift
> Issue Type: Bug
> Components: C++ - Library
> Affects Versions: 0.9.1
> Environment: Windows/Visual Studio 2010
> Reporter: Dan Small
> Attachments: sample.zip
>
>
> Below is my .idl
> I filled in a ConnectorConfig with a couple of 'xmlFiles' and
> 'delimitedFiles' each of which had several 'properties'.
> I was writing to a file using TSimpleFileTransport and TCompactProtocolT.
> When I tried to read what had been written I would get the 'No more data to
> read.' error. If I switched to using TBinaryProtocol then the problem would
> go away and everything seemed to function correctly.
> The same problem does not happen with Java.
> I tried applying the patch for issue 1833 however that didn't fix the problem.
> union PropertyLocation
> {
> 1 : i64 column
> 2 : string xpath
> }
> struct DocumentProperty
> {
> 1 : i64 datatype,
> 2 : bool dateIsUTC,
> 3 : string id,
> 4 : string displayName,
> 5 : string description,
> 6 : string dateStringFormat,
> 7 : PropertyLocation location;
> }
> struct DelimitedFormat
> {
> 1 : i32 columnDelimiter
> 2 : i32 listDelimiter
> 3 : i32 quote
> 4 : bool firstRowIsHeader
> }
> struct XMLFormat
> {
> 1 : list< string > namespaces
> }
> union FormatDetail
> {
> 1 : DelimitedFormat delimitedFormat
> 2 : XMLFormat xmlFormat
> }
> struct DocumentFormat
> {
> 1 : string id,
> 2 : string displayName,
> 3 : string description,
> 4 : list< DocumentProperty > properties;
> 5 : FormatDetail detail;
> }
> struct ConnectorConfig
> {
> 1 : i64 logRetentionDays
> 2 : i64 logLevel
> 3 : i64 logMaxFileSize
> 4 : list< DocumentFormat > xmlFiles
> 5 : list< DocumentFormat > delimitedFiles
> 6 : string logLocation
> }
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)