[ https://issues.apache.org/jira/browse/PHOENIX-671?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14258135#comment-14258135 ]
James Taylor edited comment on PHOENIX-671 at 12/24/14 9:22 AM: ---------------------------------------------------------------- Adding support for UNION would be pretty straightforward. Here's what would be required: - Add support to PhoenixSQL.g for UNION. This would just be a select_statement followed by one or more ( UNION select_statement ). - Modify QueryCompiler for the case of union to compile each individual select_statement through the standard QueryCompile method. - Produce a RowProjector that is the union of all projected expressions across all select_statements. - Produce a new UnionPlan which would pass in a List<QueryPlan> for the compilation of all other statements. - Implement the iterator() method of UnionPlan to just instantiate a ConcatIterator which is the concatenation of all iterators from the List<QueryPlan> child plans. In this case, the output would just be the concatenation of running all the select statements, one after the other, with a bit of intelligence in the formation of the RowProjector (which defines the "schema" of the tuples returned across all select statements). was (Author: jamestaylor): Adding support for UNION would be pretty straightforward. Here's what would be required: - Add support to PhoenixSQL.g for UNION. This would just be a select_statement followed by one or more { UNION select_statement}. - Modify QueryCompiler for the case of union to compile each individual select_statement through the standard QueryCompile method. - Produce a RowProjector that is the union of all projected expressions across all select_statements. - Produce a new UnionPlan which would pass in a List<QueryPlan> for the compilation of all other statements. - Implement the iterator() method of UnionPlan to just instantiate a ConcatIterator which is the concatenation of all iterators from the List<QueryPlan> child plans. In this case, the output would just be the concatenation of running all the select statements, one after the other, with a bit of intelligence in the formation of the RowProjector (which defines the "schema" of the tuples returned across all select statements). > Support UNION > ------------- > > Key: PHOENIX-671 > URL: https://issues.apache.org/jira/browse/PHOENIX-671 > Project: Phoenix > Issue Type: Task > Reporter: James Taylor > > This is particularly useful for Pentaho support. -- This message was sent by Atlassian JIRA (v6.3.4#6332)