You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by su...@apache.org on 2017/01/17 18:52:57 UTC

hive git commit: HIVE-14303: CommonJoinOperator.checkAndGenObject should return directly to avoid NPE if ExecReducer.close is called twice. (Zhihai Xu, reviewed by Chao Sun)

Repository: hive
Updated Branches:
  refs/heads/master ea87e0f26 -> f2dcdaa47


HIVE-14303: CommonJoinOperator.checkAndGenObject should return directly to avoid NPE if ExecReducer.close is called twice. (Zhihai Xu, reviewed by Chao Sun)


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

Branch: refs/heads/master
Commit: f2dcdaa472ca238e481df549446a2613588ba28e
Parents: ea87e0f
Author: Zhihai Xu <zh...@gmail.com>
Authored: Tue Jan 17 10:52:39 2017 -0800
Committer: Chao Sun <su...@apache.org>
Committed: Tue Jan 17 10:52:39 2017 -0800

----------------------------------------------------------------------
 .../apache/hadoop/hive/ql/exec/CommonJoinOperator.java    | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/f2dcdaa4/ql/src/java/org/apache/hadoop/hive/ql/exec/CommonJoinOperator.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/CommonJoinOperator.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/CommonJoinOperator.java
index 940f2dd..7e9007c 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/CommonJoinOperator.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/CommonJoinOperator.java
@@ -154,6 +154,8 @@ public abstract class CommonJoinOperator<T extends JoinDesc> extends
   protected transient int heartbeatInterval;
   protected static final int NOTSKIPBIGTABLE = -1;
 
+  private transient boolean closeOpCalled = false;
+
   /** Kryo ctor. */
   protected CommonJoinOperator() {
     super();
@@ -226,6 +228,7 @@ public abstract class CommonJoinOperator<T extends JoinDesc> extends
   @SuppressWarnings("unchecked")
   protected void initializeOp(Configuration hconf) throws HiveException {
     super.initializeOp(hconf);
+    closeOpCalled = false;
     this.handleSkewJoin = conf.getHandleSkewJoin();
     this.hconf = hconf;
 
@@ -851,6 +854,12 @@ public abstract class CommonJoinOperator<T extends JoinDesc> extends
   }
 
   protected void checkAndGenObject() throws HiveException {
+    if (closeOpCalled) {
+      LOG.warn("checkAndGenObject is called after operator " +
+          id + " " + getName() + " called closeOp");
+      return;
+    }
+
     if (condn[0].getType() == JoinDesc.UNIQUE_JOIN) {
 
       // Check if results need to be emitted.
@@ -951,6 +960,7 @@ public abstract class CommonJoinOperator<T extends JoinDesc> extends
    */
   @Override
   public void closeOp(boolean abort) throws HiveException {
+    closeOpCalled = true;
     for (AbstractRowContainer<List<Object>> alw : storage) {
       if (alw != null) {
         alw.clearRows(); // clean up the temp files