You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Vineet Garg <vg...@hortonworks.com> on 2017/03/28 21:41:04 UTC

Review Request 58004: HIVE-16228: Support for subqueries in complex expressions in SELECT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58004/
-----------------------------------------------------------

Review request for hive and Ashutosh Chauhan.


Bugs: HIVE-16228
    https://issues.apache.org/jira/browse/HIVE-16228


Repository: hive-git


Description
-------

This patch continues the work done in HIVE-16091 to add support for subqueries in SELECT for complex expressions e.g.
select 1+ <scalar_subquery> from table

Limitation
* As mentioned in JIRA this patch doesn't have support for subqueries in UDAs and UDTFs


Diffs
-----

  ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSubQueryRemoveRule.java 7c96f3d 
  ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java e75e892 
  ql/src/java/org/apache/hadoop/hive/ql/parse/SubQueryUtils.java 0ec24b5 
  ql/src/test/queries/clientnegative/subquery_select_complex_expr.q 8e6cf66 
  ql/src/test/queries/clientnegative/subquery_select_udf.q a52a5a9 
  ql/src/test/queries/clientpositive/perf/query9.q PRE-CREATION 
  ql/src/test/queries/clientpositive/subquery_select.q cb7d7aa 
  ql/src/test/results/clientnegative/subquery_in_select.q.out a8e1b99 
  ql/src/test/results/clientnegative/subquery_select_aggregate.q.out a8e1b99 
  ql/src/test/results/clientnegative/subquery_select_complex_expr.q.out a8e1b99 
  ql/src/test/results/clientnegative/subquery_select_udf.q.out a8e1b99 
  ql/src/test/results/clientpositive/llap/subquery_select.q.out 6fb253b 
  ql/src/test/results/clientpositive/perf/query9.q.out PRE-CREATION 


Diff: https://reviews.apache.org/r/58004/diff/1/


Testing
-------

Added more positive and negative test cases
Pre-commit testing


Thanks,

Vineet Garg


Re: Review Request 58004: HIVE-16228: Support for subqueries in complex expressions in SELECT

Posted by Ashutosh Chauhan <ha...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58004/#review170492
-----------------------------------------------------------




ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSubQueryRemoveRule.java
Line 67 (original), 70 (patched)
<https://reviews.apache.org/r/58004/#comment243327>

    It will be good to add a comment on how it handles nested subquery.



ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSubQueryRemoveRule.java
Line 75 (original), 78 (patched)
<https://reviews.apache.org/r/58004/#comment243326>

    This change seems unnecessary. Having rule which does narrow matching is better.


- Ashutosh Chauhan


On March 28, 2017, 9:41 p.m., Vineet Garg wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58004/
> -----------------------------------------------------------
> 
> (Updated March 28, 2017, 9:41 p.m.)
> 
> 
> Review request for hive and Ashutosh Chauhan.
> 
> 
> Bugs: HIVE-16228
>     https://issues.apache.org/jira/browse/HIVE-16228
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> This patch continues the work done in HIVE-16091 to add support for subqueries in SELECT for complex expressions e.g.
> select 1+ <scalar_subquery> from table
> 
> Limitation
> * As mentioned in JIRA this patch doesn't have support for subqueries in UDAs and UDTFs
> 
> 
> Diffs
> -----
> 
>   ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSubQueryRemoveRule.java 7c96f3d 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java e75e892 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/SubQueryUtils.java 0ec24b5 
>   ql/src/test/queries/clientnegative/subquery_select_complex_expr.q 8e6cf66 
>   ql/src/test/queries/clientnegative/subquery_select_udf.q a52a5a9 
>   ql/src/test/queries/clientpositive/perf/query9.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/subquery_select.q cb7d7aa 
>   ql/src/test/results/clientnegative/subquery_in_select.q.out a8e1b99 
>   ql/src/test/results/clientnegative/subquery_select_aggregate.q.out a8e1b99 
>   ql/src/test/results/clientnegative/subquery_select_complex_expr.q.out a8e1b99 
>   ql/src/test/results/clientnegative/subquery_select_udf.q.out a8e1b99 
>   ql/src/test/results/clientpositive/llap/subquery_select.q.out 6fb253b 
>   ql/src/test/results/clientpositive/perf/query9.q.out PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/58004/diff/1/
> 
> 
> Testing
> -------
> 
> Added more positive and negative test cases
> Pre-commit testing
> 
> 
> Thanks,
> 
> Vineet Garg
> 
>