pavibhai commented on a change in pull request #652:
URL: https://github.com/apache/orc/pull/652#discussion_r597950586
##########
File path: java/core/src/test/org/apache/orc/impl/TestInStream.java
##########
@@ -434,8 +437,30 @@ public void testCompressed() throws Exception {
int x = in.read();
assertEquals(i & 0xff, x);
}
+
+ // Forward seek test
+ int seeksPerformed = 0;
+ for(int i=0; i < 1024; ++i) {
+ long pos = positions[i].getNext();
+ positions[i].reset();
+ ByteBuffer c = ((InStream.CompressedStream) in).compressed;
+ if (pos == ((InStream.CompressedStream) in).currentCompressedStart) {
+ // Should have the same ByteBuffer if no seek has taken place
+ in.seek(positions[i]);
+ assertEquals(c, ((InStream.CompressedStream) in).compressed);
+ } else {
+ seeksPerformed += 1;
+ in.seek(positions[i]);
+ assertNotEquals(c, ((InStream.CompressedStream) in).compressed);
+ }
+ positions[i].reset();
+ assertEquals(i & 0xff, in.read());
+ }
+ assertEquals(1, seeksPerformed);
Review comment:
Makes sense let me add a separate test for this
--
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]