You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by rb...@apache.org on 2017/04/02 23:47:37 UTC

hive git commit: HIVE-16290: Stats: StatsRulesProcFactory::evaluateComparator estimates are wrong when minValue == filterValue (Rajesh Balamohan, Gopal V reviewed by Gopal V)

Repository: hive
Updated Branches:
  refs/heads/master c49a6e797 -> 5e84e4999


HIVE-16290: Stats: StatsRulesProcFactory::evaluateComparator estimates are wrong when minValue == filterValue (Rajesh Balamohan, Gopal V reviewed by Gopal V)


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

Branch: refs/heads/master
Commit: 5e84e499928ceef6e805598bbd34fa2b62524e85
Parents: c49a6e7
Author: Rajesh Balamohan <rb...@apache.org>
Authored: Mon Apr 3 05:15:00 2017 +0530
Committer: Rajesh Balamohan <rb...@apache.org>
Committed: Mon Apr 3 05:15:00 2017 +0530

----------------------------------------------------------------------
 .../stats/annotation/StatsRulesProcFactory.java     | 12 ++++++------
 .../results/clientpositive/llap/explainuser_1.q.out | 16 ++++++++--------
 .../results/clientpositive/remove_exprs_stats.q.out |  6 +++---
 3 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/5e84e499/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 3996b2e..6844713 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
@@ -719,7 +719,7 @@ public class StatsRulesProcFactory {
                 return 0;
               }
             } else {
-              if (minValue > value) {
+              if (minValue >= value) {
                 return numRows;
               }
               if (maxValue < value) {
@@ -738,7 +738,7 @@ public class StatsRulesProcFactory {
                 return 0;
               }
             } else {
-              if (minValue > value) {
+              if (minValue >= value) {
                 return numRows;
               }
               if (maxValue < value) {
@@ -759,7 +759,7 @@ public class StatsRulesProcFactory {
                 return 0;
               }
             } else {
-              if (minValue > value) {
+              if (minValue >= value) {
                 return numRows;
               }
               if (maxValue < value) {
@@ -778,7 +778,7 @@ public class StatsRulesProcFactory {
                 return 0;
               }
             } else {
-              if (minValue > value) {
+              if (minValue >= value) {
                 return numRows;
               }
               if (maxValue < value) {
@@ -797,7 +797,7 @@ public class StatsRulesProcFactory {
                 return 0;
               }
             } else {
-              if (minValue > value) {
+              if (minValue >= value) {
                 return numRows;
               }
               if (maxValue < value) {
@@ -816,7 +816,7 @@ public class StatsRulesProcFactory {
                 return 0;
               }
             } else {
-              if (minValue > value) {
+              if (minValue >= value) {
                 return numRows;
               }
               if (maxValue < value) {

http://git-wip-us.apache.org/repos/asf/hive/blob/5e84e499/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/explainuser_1.q.out b/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
index e806ef3..790efeb 100644
--- a/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
+++ b/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
@@ -510,7 +510,7 @@ Stage-0
                                             PartitionCols:_col0, _col1, _col2
                                             Group By Operator [GBY_3] (rows=1 width=101)
                                               Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(c_int)"],keys:key, c_int, c_float
-                                              Filter Operator [FIL_44] (rows=1 width=93)
+                                              Filter Operator [FIL_44] (rows=2 width=93)
                                                 predicate:(((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0)) and (c_float > 0) and ((c_int >= 1) or (c_float >= 1)) and ((UDFToFloat(c_int) + c_float) >= 0.0) and key is not null)
                                                 TableScan [TS_0] (rows=20 width=88)
                                                   default@cbo_t1,cbo_t1,Tbl:COMPLETE,Col:COMPLETE,Output:["key","c_int","c_float"]
@@ -526,7 +526,7 @@ Stage-0
                                         PartitionCols:_col0, _col1, _col2
                                         Group By Operator [GBY_14] (rows=1 width=93)
                                           Output:["_col0","_col1","_col2"],keys:key, c_int, c_float
-                                          Filter Operator [FIL_45] (rows=1 width=93)
+                                          Filter Operator [FIL_45] (rows=2 width=93)
                                             predicate:(((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0)) and (c_float > 0) and ((c_int >= 1) or (c_float >= 1)) and ((UDFToFloat(c_int) + c_float) >= 0.0) and key is not null)
                                             TableScan [TS_11] (rows=20 width=88)
                                               default@cbo_t2,cbo_t2,Tbl:COMPLETE,Col:COMPLETE,Output:["key","c_int","c_float"]
@@ -588,7 +588,7 @@ Stage-0
                                   PartitionCols:_col0, _col1, _col2
                                   Group By Operator [GBY_3] (rows=1 width=101)
                                     Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(c_int)"],keys:key, c_int, c_float
-                                    Filter Operator [FIL_34] (rows=1 width=93)
+                                    Filter Operator [FIL_34] (rows=2 width=93)
                                       predicate:(((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0)) and (c_float > 0) and ((c_int >= 1) or (c_float >= 1)) and ((UDFToFloat(c_int) + c_float) >= 0.0))
                                       TableScan [TS_0] (rows=20 width=88)
                                         default@cbo_t1,cbo_t1,Tbl:COMPLETE,Col:COMPLETE,Output:["key","c_int","c_float"]
@@ -604,7 +604,7 @@ Stage-0
                               PartitionCols:_col0, _col1, _col2
                               Group By Operator [GBY_14] (rows=1 width=93)
                                 Output:["_col0","_col1","_col2"],keys:key, c_int, c_float
-                                Filter Operator [FIL_35] (rows=1 width=93)
+                                Filter Operator [FIL_35] (rows=2 width=93)
                                   predicate:(((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0)) and (c_float > 0) and ((c_int >= 1) or (c_float >= 1)) and ((UDFToFloat(c_int) + c_float) >= 0.0))
                                   TableScan [TS_11] (rows=20 width=88)
                                     default@cbo_t2,cbo_t2,Tbl:COMPLETE,Col:COMPLETE,Output:["key","c_int","c_float"]
@@ -672,7 +672,7 @@ Stage-0
                                     PartitionCols:_col0, _col1, _col2
                                     Group By Operator [GBY_3] (rows=1 width=101)
                                       Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(c_int)"],keys:key, c_int, c_float
-                                      Filter Operator [FIL_39] (rows=1 width=93)
+                                      Filter Operator [FIL_39] (rows=2 width=93)
                                         predicate:(((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0)) and (c_float > 0) and ((c_int >= 1) or (c_float >= 1)) and ((UDFToFloat(c_int) + c_float) >= 0.0))
                                         TableScan [TS_0] (rows=20 width=88)
                                           default@cbo_t1,cbo_t1,Tbl:COMPLETE,Col:COMPLETE,Output:["key","c_int","c_float"]
@@ -692,7 +692,7 @@ Stage-0
                                     PartitionCols:_col0, _col1, _col2
                                     Group By Operator [GBY_14] (rows=1 width=101)
                                       Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(c_int)"],keys:key, c_int, c_float
-                                      Filter Operator [FIL_40] (rows=1 width=93)
+                                      Filter Operator [FIL_40] (rows=2 width=93)
                                         predicate:(((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0)) and (c_float > 0) and ((c_int >= 1) or (c_float >= 1)) and ((UDFToFloat(c_int) + c_float) >= 0.0))
                                         TableScan [TS_11] (rows=20 width=88)
                                           default@cbo_t2,cbo_t2,Tbl:COMPLETE,Col:COMPLETE,Output:["key","c_int","c_float"]
@@ -761,7 +761,7 @@ Stage-0
                                       PartitionCols:_col0, _col1, _col2
                                       Group By Operator [GBY_3] (rows=1 width=101)
                                         Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(c_int)"],keys:key, c_int, c_float
-                                        Filter Operator [FIL_39] (rows=1 width=93)
+                                        Filter Operator [FIL_39] (rows=2 width=93)
                                           predicate:(((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0)) and (c_float > 0) and ((c_int >= 1) or (c_float >= 1)) and ((UDFToFloat(c_int) + c_float) >= 0.0) and key is not null)
                                           TableScan [TS_0] (rows=20 width=88)
                                             default@cbo_t1,cbo_t1,Tbl:COMPLETE,Col:COMPLETE,Output:["key","c_int","c_float"]
@@ -777,7 +777,7 @@ Stage-0
                                       PartitionCols:_col0, _col1, _col2
                                       Group By Operator [GBY_11] (rows=1 width=93)
                                         Output:["_col0","_col1","_col2"],keys:key, c_int, c_float
-                                        Filter Operator [FIL_40] (rows=1 width=93)
+                                        Filter Operator [FIL_40] (rows=2 width=93)
                                           predicate:(((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0)) and (c_float > 0) and ((c_int >= 1) or (c_float >= 1)) and ((UDFToFloat(c_int) + c_float) >= 0.0) and key is not null)
                                           TableScan [TS_8] (rows=20 width=88)
                                             default@cbo_t2,cbo_t2,Tbl:COMPLETE,Col:COMPLETE,Output:["key","c_int","c_float"]

http://git-wip-us.apache.org/repos/asf/hive/blob/5e84e499/ql/src/test/results/clientpositive/remove_exprs_stats.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/remove_exprs_stats.q.out b/ql/src/test/results/clientpositive/remove_exprs_stats.q.out
index 567e6b2..33cf90a 100644
--- a/ql/src/test/results/clientpositive/remove_exprs_stats.q.out
+++ b/ql/src/test/results/clientpositive/remove_exprs_stats.q.out
@@ -356,14 +356,14 @@ STAGE PLANS:
             Statistics: Num rows: 8 Data size: 816 Basic stats: COMPLETE Column stats: COMPLETE
             Filter Operator
               predicate: (locid > 1) (type: boolean)
-              Statistics: Num rows: 2 Data size: 204 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 8 Data size: 816 Basic stats: COMPLETE Column stats: COMPLETE
               Select Operator
                 expressions: state (type: string), locid (type: int), zip (type: bigint), year (type: int)
                 outputColumnNames: _col0, _col1, _col2, _col3
-                Statistics: Num rows: 2 Data size: 204 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 8 Data size: 816 Basic stats: COMPLETE Column stats: COMPLETE
                 File Output Operator
                   compressed: false
-                  Statistics: Num rows: 2 Data size: 204 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 8 Data size: 816 Basic stats: COMPLETE Column stats: COMPLETE
                   table:
                       input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                       output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat