guiyanakuang commented on a change in pull request #924:
URL: https://github.com/apache/orc/pull/924#discussion_r725661709



##########
File path: java/core/src/java/org/apache/orc/impl/RecordReaderUtils.java
##########
@@ -414,7 +414,15 @@ static void readRanges(FSDataInputStream file,
     long offset = first.getOffset();
     int readSize = (int) (computeEnd(first, last) - offset);
     byte[] buffer = new byte[readSize];
-    file.readFully(offset, buffer, 0, buffer.length);
+    try {
+      file.readFully(offset, buffer, 0, buffer.length);
+    } catch(IOException e) {
+      throw new IOException(String.format("Failed while reading %s %d:%d",
+                                          file,

Review comment:
       
https://github.com/apache/orc/blob/93b7aa67830104d6bd7fc55399947ee938549f55/java/core/src/java/org/apache/orc/impl/RecordReaderUtils.java#L99-L104
   Hey guys @omalley @dongjoon-hyun @autumnust 
   It looks better to refer to the `readFileData`  on the exception catch, 
because here we can get the path variable directly (file and path are both 
member var).
   
   Call chain
   `readFileData`---->`readDiskRanges`----->`readRanges`
   `readFileData`---->`readDiskRanges`----->`zeroCopyReadRanges`
   
   And the parallel `zeroCopyReadRanges` method allows us to catch exceptions 
and print information about them in the same place.
   




-- 
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: dev-unsubscr...@orc.apache.org

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


Reply via email to