You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by xu...@apache.org on 2015/07/31 02:43:39 UTC

[39/43] hive git commit: HIVE-11330: Add early termination for recursion in StatsRulesProcFactory.evaluateExpression (Prasanth Jayachandran, reviewed by Hari Subramaniyan)

HIVE-11330: Add early termination for recursion in StatsRulesProcFactory.evaluateExpression (Prasanth Jayachandran, reviewed by Hari Subramaniyan)


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

Branch: refs/heads/spark
Commit: 4ee17e53c194501d8eaca07c3039379b56d86d26
Parents: f312d17
Author: Hari Subramaniyan <ha...@apache.org>
Authored: Wed Jul 29 14:57:31 2015 -0700
Committer: Hari Subramaniyan <ha...@apache.org>
Committed: Wed Jul 29 14:57:31 2015 -0700

----------------------------------------------------------------------
 .../hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/4ee17e53/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java
index 376d42c..1663b88 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java
@@ -301,6 +301,9 @@ public class StatsRulesProcFactory {
       long newNumRows = 0;
       Statistics andStats = null;
 
+      if (stats.getNumRows() <= 1 || stats.getDataSize() <= 0)
+        return 1;
+
       if (pred instanceof ExprNodeGenericFuncDesc) {
         ExprNodeGenericFuncDesc genFunc = (ExprNodeGenericFuncDesc) pred;
         GenericUDF udf = genFunc.getGenericUDF();