stubz151 commented on code in PR #13997:
URL: https://github.com/apache/iceberg/pull/13997#discussion_r2373059558


##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetIO.java:
##########
@@ -123,6 +136,72 @@ public void seek(long newPos) throws IOException {
     }
   }
 
+  private static class ParquetRangeReadableInputStreamAdapter<
+          T extends org.apache.iceberg.io.SeekableInputStream & RangeReadable>
+      extends DelegatingSeekableInputStream implements RangeReadable {
+    private final T delegate;
+
+    private ParquetRangeReadableInputStreamAdapter(T delegate) {
+      super(delegate);
+      this.delegate = delegate;
+    }
+
+    @Override
+    public long getPos() throws IOException {
+      return delegate.getPos();
+    }
+
+    @Override
+    public void seek(long newPos) throws IOException {
+      delegate.seek(newPos);
+    }
+
+    @Override
+    public void readFully(long position, byte[] buffer, int offset, int 
length) throws IOException {
+      delegate.readFully(position, buffer, offset, length);
+    }
+
+    @Override
+    public int readTail(byte[] buffer, int offset, int length) throws 
IOException {
+      return delegate.readTail(buffer, offset, length);
+    }
+
+    @Override
+    public boolean readVectoredAvailable(ByteBufferAllocator allocate) {
+      return true;
+    }
+
+    @Override
+    public void readVectored(List<ParquetFileRange> ranges, 
ByteBufferAllocator allocate)

Review Comment:
   I added in testRangeReadableAdapterReadVectored which does something similar 
to the tests in S3FileIO, but focused a bit more on checking that the 
buffers/ranges are being used correctly, I skipped the other operations but can 
add them in if we want. Let me know 



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

To unsubscribe, e-mail: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to