hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1628602 - /hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/stats/HiveRelMdRowCount.java
Date Wed, 01 Oct 2014 05:28:37 GMT
Author: hashutosh
Date: Wed Oct  1 05:28:37 2014
New Revision: 1628602

URL: http://svn.apache.org/r1628602
Log:
HIVE-8263 : CBO : TPC-DS Q64 is item is joined last with store_sales while it should be first
as it is the most selective (Harish Butani via Ashutosh Chauhan)

Modified:
    hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/stats/HiveRelMdRowCount.java

Modified: hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/stats/HiveRelMdRowCount.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/stats/HiveRelMdRowCount.java?rev=1628602&r1=1628601&r2=1628602&view=diff
==============================================================================
--- hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/stats/HiveRelMdRowCount.java
(original)
+++ hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/stats/HiveRelMdRowCount.java
Wed Oct  1 05:28:37 2014
@@ -222,10 +222,8 @@ public class HiveRelMdRowCount extends R
       return null;
     }
 
-    double leftRowCount = RelMetadataQuery.getRowCount(left)
-        * RelMetadataQuery.getSelectivity(left, leftPred);
-    double rightRowCount = RelMetadataQuery.getRowCount(right)
-        * RelMetadataQuery.getSelectivity(right, rightPred);
+    double leftRowCount = RelMetadataQuery.getRowCount(left);
+    double rightRowCount = RelMetadataQuery.getRowCount(right);
 
     if (leftIsKey && rightIsKey) {
       if (rightRowCount < leftRowCount) {
@@ -275,7 +273,7 @@ public class HiveRelMdRowCount extends R
       PKSideInfo pkInfo = new PKSideInfo(leftRowCount,
           leftNDV,
           joinRel.getJoinType().generatesNullsOnRight() ? 1.0 :
-            RelMetadataQuery.getSelectivity(left, leftPred));
+            isPKSideSimpleTree ? RelMetadataQuery.getSelectivity(left, leftPred) : 1.0);
 
       return new PKFKRelationInfo(1, fkInfo, pkInfo, ndvScalingFactor, isPKSideSimpleTree);
     }
@@ -286,7 +284,7 @@ public class HiveRelMdRowCount extends R
       PKSideInfo pkInfo = new PKSideInfo(rightRowCount,
           rightNDV,
           joinRel.getJoinType().generatesNullsOnLeft() ? 1.0 :
-            RelMetadataQuery.getSelectivity(right, rightPred));
+            isPKSideSimpleTree ?  RelMetadataQuery.getSelectivity(right, rightPred) : 1.0);
 
       return new PKFKRelationInfo(1, fkInfo, pkInfo, ndvScalingFactor, isPKSideSimpleTree);
     }



Mime
View raw message