orc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gang Wu (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ORC-181) ByteRleDecoder doesn't seek correctly when the runtime type is BooleanRleDecoderImpl
Date Thu, 27 Apr 2017 06:05:04 GMT
Gang Wu created ORC-181:
---------------------------

             Summary: ByteRleDecoder doesn't seek correctly when the runtime type is BooleanRleDecoderImpl
                 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


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)

Mime
View raw message