deniskuzZ commented on code in PR #6955:
URL: https://github.com/apache/hive/pull/6955#discussion_r4537369247
##########
llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/ParquetColumnVectorProducer.java:
##########
@@ -106,6 +120,25 @@ public ReadPipeline
createReadPipeline(Consumer<ColumnVectorBatch> consumer, Fil
}
}
+ /**
+ * Whether a failed footer read is the thread being interrupted rather than
the file failing to
+ * read. The cause chain is walked because the footer cache and Hadoop wrap
what they catch. A
+ * {@link SocketTimeoutException} is an {@link InterruptedIOException} too,
but it is a timeout,
+ * so it falls back like any other IO failure.
+ */
+ private static boolean isInterrupt(IOException e) {
+ if (Thread.currentThread().isInterrupted()) {
+ return true;
+ }
+ for (Throwable t = e; t != null; t = t.getCause() == t ? null :
t.getCause()) {
Review Comment:
Throwable.getCause() already returns null when the cause is the exception
itself, so `t.getCause() == t ? null : t.getCause()` does nothing.
The loop could be simplified to:
````
for (Throwable t = e; t != null; t = t.getCause()) {
````
That's the same loop as TezJobMonitor.hasInterruptedException.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]