Index: ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java (revision 337) +++ ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java (working copy) @@ -84,6 +84,8 @@ static final String IO_EXCEPTION_STREAM_CLOSED = "Stream closed"; static final String IO_EXCEPTION_PIPE_ENDED_WIN = "The pipe has been ended"; static final String IO_EXCEPTION_PIPE_CLOSED_WIN = "The pipe is being closed"; + // added for IBM JDK + static final String IO_EXCEPTION_NO_FILE_STRING ="No such file or directory"; /** * sends periodic reports back to the tracker. @@ -258,6 +260,15 @@ e.getMessage().equalsIgnoreCase(IO_EXCEPTION_STREAM_CLOSED)); } + boolean isNoFileException(IOException e) { + if (Shell.WINDOWS) { + String errMsg = e.getMessage(); + return errMsg.equalsIgnoreCase(IO_EXCEPTION_PIPE_CLOSED_WIN) || + errMsg.equalsIgnoreCase(IO_EXCEPTION_PIPE_ENDED_WIN); + } + return (e.getMessage().equalsIgnoreCase(IO_EXCEPTION_NO_FILE_STRING)); + } + boolean allowPartialConsumption() { return HiveConf.getBoolVar(hconf, HiveConf.ConfVars.ALLOWPARTIALCONSUMP); } @@ -371,7 +382,7 @@ serialize_error_count.set(serialize_error_count.get() + 1); throw new HiveException(e); } catch (IOException e) { - if (isBrokenPipeException(e) && allowPartialConsumption()) { + if ((isBrokenPipeException(e) || isNoFileException(e)) && allowPartialConsumption()) { // Give the outThread a chance to finish before marking the operator as done try { scriptPid.waitFor(); @@ -392,7 +403,7 @@ .warn("Got broken pipe during write: ignoring exception and setting operator to done"); } else { LOG.error("Error in writing to script: " + e.getMessage()); - if (isBrokenPipeException(e)) { + if (isBrokenPipeException(e) || isNoFileException(e)) { displayBrokenPipeInfo(); } scriptError = e; @@ -416,10 +427,10 @@ scriptOutWriter.close(); } } catch (IOException e) { - if (isBrokenPipeException(e) && allowPartialConsumption()) { + if ((isBrokenPipeException(e) || isNoFileException(e)) && allowPartialConsumption()) { LOG.warn("Got broken pipe: ignoring exception"); } else { - if (isBrokenPipeException(e)) { + if (isBrokenPipeException(e) || isNoFileException(e)) { displayBrokenPipeInfo(); } throw e;