Uploaded image for project: 'ORC'
  1. ORC
  2. ORC-181

ByteRleDecoder doesn't seek correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 1.3.4, 1.4.0
    • C++
    • None

    Description

      ByteRleDecoder doesn't seek correctly when the runtime type is BooleanRleDecoderImpl. The following piece of code is located at ByteRLE.cc line 254:

      ByteRLE.cc
        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);
          }
        }
      

      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:

      ByteRLE.cc
        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());
        }
      

      However, at the end of ByteRleDecoderImpl::seek(), it calls skip(location.next()) which is actually BooleanRleDecoderImpl::skip() not ByteRleDecoderImpl::skip(). Oops!

      Attachments

        Issue Links

          Activity

            People

              wgtmac Gang Wu
              wgtmac Gang Wu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: