You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "danielcweeks (via GitHub)" <gi...@apache.org> on 2023/02/22 19:22:37 UTC

[GitHub] [iceberg] danielcweeks commented on a diff in pull request #6887: API: Replace special case of deprecated RuntimeIOException with FileHandlingException

danielcweeks commented on code in PR #6887:
URL: https://github.com/apache/iceberg/pull/6887#discussion_r1114851613


##########
core/src/main/java/org/apache/iceberg/avro/AvroIO.java:
##########
@@ -178,7 +179,7 @@ static long findStartingRowPos(Supplier<SeekableInputStream> open, long start) {
           SYNC_READER.read(decoder, blockSync);
 
           if (!Arrays.equals(fileSync, blockSync)) {
-            throw new RuntimeIOException("Invalid sync at %s", nextSyncPos);
+            throw new FileHandlingException("Invalid sync at %s", nextSyncPos);

Review Comment:
   We might be able to find a better exception for this.  I'm not clear on what this sync check is, but maybe there's something more appropriate we can use.



##########
core/src/main/java/org/apache/iceberg/avro/AvroFileAppender.java:
##########
@@ -85,7 +86,7 @@ public long length() {
         throw new RuntimeIOException(e, "Failed to get stream length");
       }
     }
-    throw new RuntimeIOException("Failed to get stream length: no open stream");
+    throw new FileHandlingException("Failed to get stream length: no open stream");

Review Comment:
   Could we change this to a precondition check as opposed to file exception?



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org