hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject hive git commit: HIVE-16309 : Hive Test Commands failure should be printed in hive.log in addition to stderr
Date Wed, 29 Mar 2017 16:45:30 GMT
Repository: hive
Updated Branches:
  refs/heads/master b2bc24b77 -> 72a88190d


HIVE-16309 : Hive Test Commands failure should be printed in hive.log in addition to stderr

Signed-off-by: Ashutosh Chauhan <hashutosh@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/72a88190
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/72a88190
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/72a88190

Branch: refs/heads/master
Commit: 72a88190d4798708e2eb517b2ae82dc8abe2315b
Parents: b2bc24b
Author: Sahil Takiar <takiar.sahil@gmail.com>
Authored: Wed Mar 29 09:44:47 2017 -0700
Committer: Ashutosh Chauhan <hashutosh@apache.org>
Committed: Wed Mar 29 09:44:47 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hive/ql/QTestUtil.java    |  6 ++++--
 .../hive/ql/processors/CommandProcessorResponse.java      | 10 +++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/72a88190/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java
----------------------------------------------------------------------
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.Matcher;
 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 @@ public class QTestUtil {
 
         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 @@ public class QTestUtil {
         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);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/72a88190/ql/src/java/org/apache/hadoop/hive/ql/processors/CommandProcessorResponse.java
----------------------------------------------------------------------
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 class CommandProcessorResponse {
   public int getErrorCode() { return hiveErrorCode; }
   public List<String> 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()) + ")";
   }
 }


Mime
View raw message