stubz151 commented on code in PR #13997: URL: https://github.com/apache/iceberg/pull/13997#discussion_r2344693632
########## parquet/src/main/java/org/apache/iceberg/parquet/ParquetIO.java: ########## @@ -123,6 +135,64 @@ 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) + throws IOException { + IntFunction<ByteBuffer> delegateAllocate = (allocate::allocate); + List<FileRange> delegateRange = convertRanges(ranges); Review Comment: From my testing it isn't doing that, In the read vector implementation in rangeReadable you can see we only setting the buffers when we start the read, and the way parquet keeps track of that is with the CompletableFuture -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org