[ 
https://issues.apache.org/jira/browse/PHOENIX-945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14163014#comment-14163014
 ] 

Hudson commented on PHOENIX-945:
--------------------------------

SUCCESS: Integrated in Phoenix | Master #410 (See 
[https://builds.apache.org/job/Phoenix-master/410/])
PHOENIX-945 Support correlated subqueries in comparison without ANY/SOME/ALL 
(maryannxue: rev 5282a8a09fec1ea7a6241565ff034246e3b30b92)
* phoenix-core/src/main/java/org/apache/phoenix/compile/SubqueryRewriter.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/StatementNormalizer.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/ExpressionCompiler.java
* phoenix-core/src/it/java/org/apache/phoenix/end2end/SubqueryIT.java
* phoenix-core/src/main/java/org/apache/phoenix/parse/ParseNodeFactory.java


> Support correlated subqueries in comparison without ANY/SOME/ALL
> ----------------------------------------------------------------
>
>                 Key: PHOENIX-945
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-945
>             Project: Phoenix
>          Issue Type: Sub-task
>    Affects Versions: 3.0.0, 4.0.0, 5.0.0
>            Reporter: Maryann Xue
>            Assignee: Maryann Xue
>             Fix For: 3.0.0, 4.0.0, 5.0.0
>
>         Attachments: 945-2.patch, 945.patch
>
>   Original Estimate: 336h
>  Remaining Estimate: 336h
>
> Example:
>  SELECT employee_number, name
>    FROM employees AS Bob
>    WHERE salary > (
>      SELECT AVG(salary)
>        FROM employees
>        WHERE department = Bob.department);
> Basically we can optimize these queries into join queries, like:
>  SELECT employees.employee_number, employees.name
>    FROM employees INNER JOIN
>      (SELECT department, AVG(salary) AS department_average
>        FROM employees
>        GROUP BY department) AS temp ON employees.department = temp.department
>    WHERE employees.salary > temp.department_average;



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to