ajantha-bhat commented on code in PR #6887: URL: https://github.com/apache/iceberg/pull/6887#discussion_r1419010809
########## core/src/main/java/org/apache/iceberg/avro/AvroFileAppender.java: ########## @@ -78,14 +78,13 @@ public Metrics metrics() { @Override public long length() { - if (stream != null) { - try { - return stream.getPos(); - } catch (IOException e) { - throw new RuntimeIOException(e, "Failed to get stream length"); - } + Preconditions.checkNotNull(stream, "Failed to get stream length: no open stream"); + + try { + return stream.getPos(); + } catch (IOException e) { + throw new RuntimeIOException(e, "Failed to get stream length"); Review Comment: Sorry. I got confused. There was two `RuntimeIOException` from this length() method. Now, one is replaced with `IllegalStateException` as per Dan's comment. So, there will still be one `RuntimeIOException` (which will be replaced with `UncheckedIOException` in the main PR as it has a cause of `IOException`) -- 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