diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java index 9631af4..2abf252 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java @@ -64,6 +64,7 @@ import java.util.regex.Pattern; import com.google.common.base.Preconditions; +import com.google.common.base.Throwables; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; @@ -1395,7 +1396,8 @@ private int executeTestCommand(final String command) { int rc = response.getResponseCode(); if (rc != 0) { - SessionState.get().out.println(response); + SessionState.getConsole().printError(response.toString(), response.getException() != null ? + Throwables.getStackTraceAsString(response.getException()) : ""); } return rc; @@ -1403,7 +1405,7 @@ private int executeTestCommand(final String command) { throw new RuntimeException("Could not get CommandProcessor for command: " + commandName); } } catch (Exception e) { - throw new RuntimeException("Could not execute test command: " + e.getMessage()); + throw new RuntimeException("Could not execute test command", e); } } diff --git a/ql/src/java/org/apache/hadoop/hive/ql/processors/CommandProcessorResponse.java b/ql/src/java/org/apache/hadoop/hive/ql/processors/CommandProcessorResponse.java index d4f35f1..e78ea45 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/processors/CommandProcessorResponse.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/processors/CommandProcessorResponse.java @@ -99,10 +99,10 @@ public CommandProcessorResponse(int responseCode, String errorMessage, String SQ public int getErrorCode() { return hiveErrorCode; } public List getConsoleMessages() { return consoleMessages; } public String toString() { - return "(" + responseCode + "," + errorMessage + "," + - (hiveErrorCode > 0 ? hiveErrorCode + "," : "" ) + - SQLState + - (resSchema == null ? "" : ",") + - (exception == null ? "" : exception.getMessage()) + ")"; + return "(responseCode = " + responseCode + ", errorMessage = " + errorMessage + ", " + + (hiveErrorCode > 0 ? "hiveErrorCode = " + hiveErrorCode + ", " : "" ) + + "SQLState = " + SQLState + + (resSchema == null ? "" : ", resSchema = " + resSchema) + + (exception == null ? "" : ", exception = " + exception.getMessage()) + ")"; } }