You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Maryann Xue (JIRA)" <ji...@apache.org> on 2015/04/06 23:52:12 UTC
[jira] [Updated] (PHOENIX-1807) Support UNION queries in subquery
[ https://issues.apache.org/jira/browse/PHOENIX-1807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Maryann Xue updated PHOENIX-1807:
---------------------------------
Attachment: PHOENIX-1807.patch
1. Fix union query top-level "select" nodes with a list of adjusted aliases from a non-wildcard sub-select if any:
a) No check the number of select nodes among all sub-selects, since it will be done later at compile stage.
b) We simply create a temporary alias if no column name or alias is present, since it cannot be referred by outer queries.
2. Remove constructor of SelectStatement without "sub-selects", in order to force awareness of sub-selects when constructing a SelectStatement.
There are quite a few different signatures of select() method in ParseNodeFactory now, and I think we should follow a convention for calling these select() methods:
1) To rewrite a SelectStatement by replacing some part of it or adding a new clause to it, we should use methods like select(Statement select, ...), which copies every part of the old SelectStatement to the new one unless specified otherwise, including the *sub-selects*. For example, filter push-down or order-by push-down.
2) To construct a new SelectStatement using none or some parts of an existing SelectStatement, we should call select(TableNode from, HintNode hint, ...) with the full parameter list. For example, construction of a SelectStatement in DeleteCompiler.
> Support UNION queries in subquery
> ---------------------------------
>
> Key: PHOENIX-1807
> URL: https://issues.apache.org/jira/browse/PHOENIX-1807
> Project: Phoenix
> Issue Type: New Feature
> Reporter: Maryann Xue
> Assignee: Maryann Xue
> Fix For: 4.4.0
>
> Attachments: PHOENIX-1807.patch
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> Example:
> select * from aTable where pk in (select pk from idx1 where q1 = 'x' union all select pk from idx2 where q2 = 'y')
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)