Index: ql/src/java/org/apache/hadoop/hive/ql/io/RCFile.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/io/RCFile.java (revision 1215053) +++ ql/src/java/org/apache/hadoop/hive/ql/io/RCFile.java (working copy) @@ -158,6 +158,11 @@ public static final String TOLERATE_CORRUPTIONS_CONF_STR = "hive.io.rcfile.tolerate.corruptions"; + // HACK: We actually need BlockMissingException, but that is not available + // in all hadoop versions. + public static final String BLOCK_MISSING_MESSAGE = + "Could not obtain block"; + /* * these header and Sync are kept from SequenceFile, for compatible of * SequenceFile's format. @@ -1549,18 +1554,16 @@ try { ret = nextKeyBuffer(); this.currentValueBuffer(); - } catch (EOFException eof) { - LOG.warn("Ignoring EOFException in file " + file + - " after offset " + currentOffset, eof); + } catch (IOException ioe) { + // A BlockMissingException indicates a temporary error, + // not a corruption. Re-throw this exception. + if (ioe.getMessage().startsWith(BLOCK_MISSING_MESSAGE)) { + throw ioe; + } + // We have an IOException other than a BlockMissingException. + LOG.warn("Ignoring IOException in file " + file + + " after offset " + currentOffset, ioe); ret = -1; - } catch (ChecksumException ce) { - LOG.warn("Ignoring ChecksumException in file " + file + - " after offset " + currentOffset, ce); - ret = -1; - } catch (IOException ioe) { - // We have an IOException other than EOF or ChecksumException - // This is likely a read-error, not corruption, re-throw. - throw ioe; } catch (Throwable t) { // We got an exception that is not IOException // (typically OOM, IndexOutOfBounds, InternalError).