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



##########
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) {

Review comment:
       @omalley !seeked would mean that previously a readHeader has taken place 
which would result in the uncompressed being allocated, unless when someone 
seeks to -1.
   
   I see that a read following a seek even in this case shall allocate 
uncompressed and do the required, so just adding documentation to describe the 
scenario.




-- 
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