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

Alicia Ying Shu edited comment on PHOENIX-1580 at 3/18/15 1:04 AM:
-------------------------------------------------------------------

[~jamestaylor], [~maryannxue] Thanks for reviewing the patch! I modified the 
patch accordingly and will upload another one soon. Agree that no need to 
expose UNION ALL in PhoenixStatement. Simplified parser code, keep parse nodes 
stay immutable and corrected format. A few points:

1. isUnionAll=false in parser code is a placeholder for handling UNION 
ALL/UNION. We can use it to distinguish UNION from UNION ALL later.
2. There is one Join test included already in UnionAllIT.java: 
testJoinInUnionAll().
3. There is one Order By test included already in UnionAllIT.java:  
testOrderBy(). Will add one test for LIMIT.  
4. I checked ORDER BY and LIMIT clauses inside QueryCompiler.java. If they are 
found in the subSelects except the last one, error out.  If found Order By in 
the last subSelect, will rewrite the select to eliminate the ORDER BY after 
getting ORDER BY information for union plan. Will do the same for LIMIT if 
found. LIMIT is used in the final union plan. There is no need to change parser 
codes at this point. 
5. Removed "setPlans()", it was not used in my current codes. 


was (Author: aliciashu):
[~jamestaylor], [~maryannxue] Thanks for reviewing the patch! I modified the 
patch accordingly and will upload another one soon. Agree that no need to 
expose UNION ALL in PhoenixStatement. Simplified parser code, keep parse nodes 
stay immutable and corrected format. A few points:

1. isUnionAll=false in parser code is a placeholder for handling UNION 
ALL/UNION. We can use it to distinguish UNION from UNION ALL later.
2. There is one Join test included already in UnionAllIT.java: 
testJoinInUnionAll().
3. There is one Order By test included already in UnionAllIT.java:  
testOrderBy(). Will add one test for LIMIT.  
4. I checked ORDER BY and LIMIT clauses inside QueryCompiler.java. If they are 
found in the subSelects except the last one, error out.  If found Order By in 
the last subSelect, will rewrite the select to eliminate the ORDER BY after 
getting ORDER BY information for union plan. Since LIMIT in the subSelect will 
not impact the final result, currently let it stay in the last SELECT 
statement. I can also rewrite the last select to remove LIMIT. LIMIT is used in 
the final union plan. There is no need to change parser code at this point. 
5. Removed "setPlans()", it was not used in my current codes. 

> Support UNION ALL
> -----------------
>
>                 Key: PHOENIX-1580
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1580
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Alicia Ying Shu
>            Assignee: Alicia Ying Shu
>         Attachments: phoenix-1580.patch, unionall-wipe.patch
>
>
> Select * from T1
> UNION ALL
> Select * from T2



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

Reply via email to