[ 
https://issues.apache.org/jira/browse/ORC-181?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Owen O'Malley resolved ORC-181.
-------------------------------
       Resolution: Fixed
    Fix Version/s: 1.4.0
                   1.3.4

I just committed this. Thanks, Gang!

> ByteRleDecoder doesn't seek correctly
> -------------------------------------
>
>                 Key: ORC-181
>                 URL: https://issues.apache.org/jira/browse/ORC-181
>             Project: ORC
>          Issue Type: Bug
>          Components: C++
>    Affects Versions: 1.0.0
>            Reporter: Gang Wu
>            Assignee: Gang Wu
>             Fix For: 1.3.4, 1.4.0
>
>
> ByteRleDecoder doesn't seek correctly when the runtime type is 
> BooleanRleDecoderImpl. The following piece of code is located at ByteRLE.cc 
> line 254:
> {code:title=ByteRLE.cc|borderStyle=solid}
>   void BooleanRleDecoderImpl::seek(PositionProvider& location) {
>     ByteRleDecoderImpl::seek(location);
>     uint64_t consumed = location.next();
>     if (consumed > 8) {
>       throw ParseError("bad position");
>     }
>     if (consumed != 0) {
>       remainingBits = 8 - consumed;
>       ByteRleDecoderImpl::next(&lastByte, 1, 0);
>     }
>   }
> {code}
> The basic idea of this function is to seek to the right position in the byte 
> stream and then seek to the right bit in a specific byte. Therefore, firstly 
> it calls ByteRleDecoderImpl::seek(location) first which is located at 
> ByteRLE.cc line 113 as below:
> {code:title=ByteRLE.cc|borderStyle=solid}
>   void ByteRleDecoderImpl::seek(PositionProvider& location) {
>     // move the input stream
>     inputStream->seek(location);
>     // force a re-read from the stream
>     bufferEnd = bufferStart;
>     // read a new header
>     readHeader();
>     // skip ahead the given number of records
>     skip(location.next());
>   }
> {code}
> However, at the end of ByteRleDecoderImpl::seek(), it calls 
> skip(location.next()) which is actually BooleanRleDecoderImpl::skip() not 
> ByteRleDecoderImpl::skip(). Oops!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to