nastra commented on code in PR #12079: URL: https://github.com/apache/iceberg/pull/12079#discussion_r1932380455
########## parquet/src/test/java/org/apache/iceberg/parquet/TestParquet.java: ########## @@ -219,6 +228,191 @@ public void testTwoLevelList() throws IOException { assertThat(recordRead.get("topbytes")).isEqualTo(expectedBinary); } + @Test + public void testStreamClosedProperly() throws IOException { + // test for input + { + class TestStreamClosedProperlyStream extends SeekableInputStream + implements DelegatingInputStream { + boolean thisClosed = false; + boolean delegateClosed = false; + + { + reset(); + } + + @Override + public InputStream getDelegate() { + return new FSDataInputStream( + new InputStream() { + @Override + public int read() throws IOException { + return 0; + } + + @Override + public void close() throws IOException { + delegateClosed = true; + } + }); + } + + @Override + public long getPos() throws IOException { + return 0; + } + + @Override + public void seek(long newPos) throws IOException {} + + @Override + public int read() throws IOException { + return 0; + } + + @Override + public void close() throws IOException { + thisClosed = true; + delegateClosed = true; + } + + public void reset() { + thisClosed = false; + delegateClosed = false; + } + } + + try (TestStreamClosedProperlyStream stream = new TestStreamClosedProperlyStream()) { + try (org.apache.parquet.io.SeekableInputStream _unused = Review Comment: please separate this into their own test methods, where one test methods makes sure to cover the input stream and the other the output stream -- 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