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

James Taylor commented on PHOENIX-1580:
---------------------------------------

That's a good suggestion, [~maryannxue] and brings up a different issue. Your 
getExplainPlan() can be simplified to go through the ResultIterator tree (and 
not force you to copy/paste code from other ResultIterator implementations). 
You can do that like this:
{code}
+    @Override
+    public ExplainPlan getExplainPlan() throws SQLException {
+        List<String> steps = new ArrayList<String>();
+        steps.add("UNION ALL " + plans.size() + " queries\n");
+        ResultIterator iterator = getIterator(Collections.emptyList());
+        iterator.explain(steps);
+        return new ExplainPlan(steps);
+    }
{code}

Then either file a separate JIRA to change " SORTED BY " to " MERGE SORTED BY" 
in OrderedResultIterator.explain(), as that's a better description. There may 
be test failures as a result, though, as we compare against the explain plan 
text in a lot of tests, so separate JIRA for that change is fine.



> 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-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)

Reply via email to