You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by sz...@apache.org on 2016/07/27 17:07:06 UTC

hive git commit: HIVE-14335 : TaskDisplay's return value is not getting deserialized properly (Rajat Khandelwal via Szehon)

Repository: hive
Updated Branches:
  refs/heads/master 8b9263e20 -> 78d335612


HIVE-14335 : TaskDisplay's return value is not getting deserialized properly (Rajat Khandelwal via Szehon)


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

Branch: refs/heads/master
Commit: 78d3356127b96892e75ac243d554daee77612022
Parents: 8b9263e
Author: Szehon Ho <sz...@criteo.com>
Authored: Wed Jul 27 10:05:26 2016 -0700
Committer: Szehon Ho <sz...@criteo.com>
Committed: Wed Jul 27 10:05:26 2016 -0700

----------------------------------------------------------------------
 ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java | 12 ++++++------
 .../org/apache/hive/service/cli/CLIServiceTest.java     |  3 +++
 2 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/78d33561/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java b/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java
index 703e997..bf6cb91 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java
@@ -65,7 +65,7 @@ public class QueryDisplay {
   @JsonIgnoreProperties(ignoreUnknown = true)
   public static class TaskDisplay {
 
-    private Integer returnVal;  //if set, determines that task is complete.
+    private Integer returnValue;  //if set, determines that task is complete.
     private String errorMsg;
 
     private Long beginTime;
@@ -95,12 +95,12 @@ public class QueryDisplay {
     }
     @JsonIgnore
     public synchronized String getStatus() {
-      if (returnVal == null) {
+      if (returnValue == null) {
         return "Running";
-      } else if (returnVal == 0) {
+      } else if (returnValue == 0) {
         return "Success, ReturnVal 0";
       } else {
-        return "Failure, ReturnVal " + String.valueOf(returnVal);
+        return "Failure, ReturnVal " + String.valueOf(returnValue);
       }
     }
 
@@ -116,7 +116,7 @@ public class QueryDisplay {
     }
 
     public synchronized Integer getReturnValue() {
-      return returnVal;
+      return returnValue;
     }
 
     public synchronized String getErrorMsg() {
@@ -186,7 +186,7 @@ public class QueryDisplay {
   public synchronized void setTaskResult(String taskId, TaskResult result) {
     TaskDisplay taskDisplay = tasks.get(taskId);
     if (taskDisplay != null) {
-      taskDisplay.returnVal = result.getExitVal();
+      taskDisplay.returnValue = result.getExitVal();
       if (result.getTaskError() != null) {
         taskDisplay.errorMsg = result.getTaskError().toString();
       }

http://git-wip-us.apache.org/repos/asf/hive/blob/78d33561/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java
----------------------------------------------------------------------
diff --git a/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java b/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java
index fb8ee4c..17d45ec 100644
--- a/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java
+++ b/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java
@@ -666,6 +666,9 @@ public abstract class CLIServiceTest {
       if (OperationState.CANCELED == state || state == OperationState.CLOSED
         || state == OperationState.FINISHED
         || state == OperationState.ERROR) {
+        for (QueryDisplay.TaskDisplay display: taskStatuses) {
+          assertNotNull(display.getReturnValue());
+        }
         break;
       }
       Thread.sleep(1000);