pavibhai commented on a change in pull request #652:
URL: https://github.com/apache/orc/pull/652#discussion_r597950429



##########
File path: java/core/src/java/org/apache/orc/impl/InStream.java
##########
@@ -551,15 +556,20 @@ public void changeIv(Consumer<byte[]> modifier) {
 
     @Override
     public void seek(PositionProvider index) throws IOException {
-      seek(index.getNext());
+      boolean seeked = seek(index.getNext());
       long uncompressedBytes = index.getNext();
-      if (uncompressedBytes != 0) {
-        readHeader();
-        uncompressed.position(uncompressed.position() +
-                              (int) uncompressedBytes);
-      } else if (uncompressed != null) {
-        // mark the uncompressed buffer as done
-        uncompressed.position(uncompressed.limit());
+      if (!seeked && uncompressed != null) {
+        // Only reposition uncompressed
+        uncompressed.position((int) uncompressedBytes);
+      } else {
+        if (uncompressedBytes != 0) {

Review comment:
       Added




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to