You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by om...@apache.org on 2015/11/17 21:19:47 UTC
[36/43] hive git commit: HIVE-11955 : Add costing for join-groupby
transpose rule (Ashutosh Chauhan via Jesus Camacho Rodriguez)
HIVE-11955 : Add costing for join-groupby transpose rule (Ashutosh Chauhan via Jesus Camacho Rodriguez)
Signed-off-by: Ashutosh Chauhan <ha...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/fd54e595
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/fd54e595
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/fd54e595
Branch: refs/heads/master-fixed
Commit: fd54e595245b075e86c2191245f9938f9c64d1b4
Parents: 58e07b1
Author: Ashutosh Chauhan <ha...@apache.org>
Authored: Wed Nov 11 14:31:36 2015 -0800
Committer: Owen O'Malley <om...@apache.org>
Committed: Tue Nov 17 12:18:34 2015 -0800
----------------------------------------------------------------------
.../calcite/rules/HiveAggregateJoinTransposeRule.java | 8 ++++++++
1 file changed, 8 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/fd54e595/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