[ https://issues.apache.org/jira/browse/PHOENIX-1580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14394012#comment-14394012 ]
Maryann Xue commented on PHOENIX-1580: -------------------------------------- [~ayingshu] Could you please make sure that you have all the changes in my patch applied in your own? 1. I already added SelectStatement.isUnion() and removed the below lines in my patch, but not sure why they came back again. {code} this.select = select; @@ -133,6 +132,19 @@ public class QueryCompiler { scan.setCaching(statement.getFetchSize()); this.originalScan = ScanUtil.newScan(scan); + if (!select.getSelects().isEmpty()) { + this.isUnionAll = true; + } else { + this.isUnionAll = false; + } + } + + public QueryCompiler(PhoenixStatement statement, SelectStatement select, ColumnResolver resolver, List<? extends PDatum> targetColumns, ParallelIteratorFactory parallelIteratorFactory, SequenceManager sequenceManager) throws SQLException { + this(statement, select, resolver, targetColumns, parallelIteratorFactory, sequenceManager, true); + } + + private boolean isUnionAll() { + return isUnionAll; } {code} 2. I don't think UnionCompiler.constructResultProjector() is called anywhere, you can just remove it. 3. Please do apply the changes to ParseNodeFactory and SelectStatement in the patch I submitted yesterday. And just remember to remove that string comparison of error message in your test case (also in the patch). 4. Does this change make any sense? Would it be ok just recover it to what it was? {code} - select = JoinCompiler.optimize(statement, select, resolver); + select = JoinCompiler.optimize(statement, select, this.resolver); {code} > 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-grammar.patch, Phoenix-1580-v1.patch, > Phoenix-1580-v2.patch, Phoenix-1580-v3.patch, Phoenix-1580-v4.patch, > Phoenix-1580-v5.patch, Phoenix-1580-v6.patch, Phoenix-1580-v7.patch, > phoenix-1580-v1-wipe.patch, 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)