----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/60349/#review179973 -----------------------------------------------------------
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRemoveSqCountCheck.java Lines 42 (patched) <https://reviews.apache.org/r/60349/#comment254951> Add some comment on what rule does. ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRemoveSqCountCheck.java Lines 74 (patched) <https://reviews.apache.org/r/60349/#comment254952> Comment seems misplaced. ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSubQueryRemoveRule.java Lines 178 (patched) <https://reviews.apache.org/r/60349/#comment254954> Lets add a flag (with default off) hive.optimize.remove.sq_count_check which doesnt add this project, that way we avoid problem of both join order as well as join merging. ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSubQueryRemoveRule.java Lines 202 (patched) <https://reviews.apache.org/r/60349/#comment254953> can be deleted. ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java Lines 1533-1536 (patched) <https://reviews.apache.org/r/60349/#comment254955> Rule will fire only when flag is on. - Ashutosh Chauhan On June 26, 2017, 9:06 p.m., Vineet Garg wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/60349/ > ----------------------------------------------------------- > > (Updated June 26, 2017, 9:06 p.m.) > > > Review request for hive and Ashutosh Chauhan. > > > Bugs: HIVE-16793 > https://issues.apache.org/jira/browse/HIVE-16793 > > > Repository: hive-git > > > Description > ------- > > For scalar subqueries we skip adding UDF sq_count_check which have aggregates > but we add it if there is a explicit group by present. We can skip it if > group by is present but group by keys are constant. This patch adds a rule to > do this optimization. > > > Diffs > ----- > > > ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRemoveSqCountCheck.java > PRE-CREATION > > ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSubQueryRemoveRule.java > 83d3f7436d > ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java 88054e7379 > ql/src/test/results/clientnegative/subquery_scalar_multi_rows.q.out > 0a780db7ef > ql/src/test/results/clientpositive/llap/subquery_scalar.q.out ceccc88b2e > ql/src/test/results/clientpositive/llap/subquery_select.q.out 440e9d7b55 > ql/src/test/results/clientpositive/perf/query23.q.out ebd2271108 > ql/src/test/results/clientpositive/perf/query44.q.out 07187b14d4 > ql/src/test/results/clientpositive/perf/query54.q.out b9d0b8b376 > ql/src/test/results/clientpositive/perf/query58.q.out 5b37f36386 > ql/src/test/results/clientpositive/perf/query6.q.out 03fff79951 > > > Diff: https://reviews.apache.org/r/60349/diff/2/ > > > Testing > ------- > > -Pre-commit testing > - new tests > > > Thanks, > > Vineet Garg > >