hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xu...@apache.org
Subject [09/18] hive git commit: HIVE-11955 : Add costing for join-groupby transpose rule (Ashutosh Chauhan via Jesus Camacho Rodriguez)
Date Tue, 17 Nov 2015 16:05:49 GMT
HIVE-11955 : Add costing for join-groupby transpose rule (Ashutosh Chauhan via Jesus Camacho
Rodriguez)

Signed-off-by: Ashutosh Chauhan <hashutosh@apache.org>


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

Branch: refs/heads/spark
Commit: 0804ddb5c63d43187c30e86af4b90f8ad86dc1d0
Parents: d2fd006
Author: Ashutosh Chauhan <hashutosh@apache.org>
Authored: Wed Nov 11 14:31:36 2015 -0800
Committer: Ashutosh Chauhan <hashutosh@apache.org>
Committed: Fri Nov 13 07:36:46 2015 -0800

----------------------------------------------------------------------
 .../calcite/rules/HiveAggregateJoinTransposeRule.java        | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/0804ddb5/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveAggregateJoinTransposeRule.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveAggregateJoinTransposeRule.java
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveAggregateJoinTransposeRule.java
index 211b6fa..c59af39 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveAggregateJoinTransposeRule.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveAggregateJoinTransposeRule.java
@@ -296,6 +296,14 @@ public class HiveAggregateJoinTransposeRule extends AggregateJoinTransposeRule
{
           Mappings.apply2(mapping, aggregate.getGroupSets()), newAggCalls);
     }
     call.transformTo(r);
+    // Add original tree as well for potential alternative transformation.
+    // This is modeled after LoptOptimizeJoinRule::findBestOrderings() in
+    // which rule adds multiple transformations and Planner picks the cheapest one.
+    // Hep planner will automatically pick the one with lower cost among two.
+    // For details, see: HepPlanner:applyTransformationResults()
+    // In this case, if ndv is close to # of rows, i.e., group by is not resulting
+    // in any deduction, doing this transformation is not useful.
+    call.transformTo(aggregate);
   }
 
   /** Computes the closure of a set of columns according to a given list of


Mime
View raw message