hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sunc...@apache.org
Subject hive git commit: HIVE-12189: The list in pushdownPreds of ppd.ExprWalkerInfo should not be allowed to grow very large (Yongzhi Chen, reviewed by Chao Sun)
Date Mon, 26 Oct 2015 06:25:42 GMT
Repository: hive
Updated Branches:
  refs/heads/master 9ea51d122 -> f415ce956


HIVE-12189: The list in pushdownPreds of ppd.ExprWalkerInfo should not be allowed to grow
very large (Yongzhi Chen, 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/f415ce95
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/f415ce95
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/f415ce95

Branch: refs/heads/master
Commit: f415ce9567661dcdc4b68b49ccb6ee4962a330e4
Parents: 9ea51d1
Author: Yongzhi Chen <yongzhi_chen@hotmail.com>
Authored: Sun Oct 25 23:24:31 2015 -0700
Committer: Chao Sun <sunchao@apache.org>
Committed: Sun Oct 25 23:24:31 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hive/ql/ppd/ExprWalkerInfo.java      | 23 ++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/f415ce95/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerInfo.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerInfo.java b/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerInfo.java
index e4b768e..fca671c 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerInfo.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerInfo.java
@@ -149,7 +149,13 @@ public class ExprWalkerInfo implements NodeProcessorCtx {
   }
 
   public void addFinalCandidate(String alias, ExprNodeDesc expr) {
-    getPushdownPreds(alias).add(expr);
+    List<ExprNodeDesc> predicates = getPushdownPreds(alias);
+    for (ExprNodeDesc curPred: predicates) {
+      if (curPred.isSame(expr)) {
+        return;
+      }
+    }
+    predicates.add(expr);
   }
 
   /**
@@ -159,7 +165,20 @@ public class ExprWalkerInfo implements NodeProcessorCtx {
    * @param pushDowns
    */
   public void addPushDowns(String alias, List<ExprNodeDesc> pushDowns) {
-    getPushdownPreds(alias).addAll(pushDowns);
+    List<ExprNodeDesc> predicates = getPushdownPreds(alias);
+    boolean isNew;
+    for (ExprNodeDesc newPred: pushDowns) {
+      isNew = true;
+      for (ExprNodeDesc curPred: predicates) {
+        if (curPred.isSame(newPred)) {
+          isNew = false;
+          break;
+        }
+      }
+      if (isNew) {
+        predicates.add(newPred);
+      }
+    }
   }
 
   /**


Mime
View raw message