[
https://issues.apache.org/jira/browse/PHOENIX-927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13967308#comment-13967308
]
ASF GitHub Bot commented on PHOENIX-927:
----------------------------------------
Github user maryannxue commented on a diff in the pull request:
https://github.com/apache/incubator-phoenix/pull/28#discussion_r11557199
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java ---
@@ -385,7 +392,37 @@ public Void visit(NamedTableNode tableNode) throws
SQLException {
@Override
public Void visit(DerivedTableNode subselectNode) throws
SQLException {
- throw new SQLFeatureNotSupportedException();
+ List<AliasedNode> selectNodes =
subselectNode.getSelect().getSelect();
+ List<PColumn> columns = new ArrayList<PColumn>();
+ int position = 0;
+ for (AliasedNode aliasedNode : selectNodes) {
+ String alias = aliasedNode.getAlias();
+ if (alias == null) {
+ ParseNode node = aliasedNode.getNode();
+ if (node instanceof WildcardParseNode
+ || node instanceof TableWildcardParseNode
+ || node instanceof FamilyWildcardParseNode)
+ throw new SQLException("Encountered wildcard in
subqueries.");
--- End diff --
Don't know if wildcard select makes sense here. Good reminder, though :)
Let me add a TODO here and check the specs.
> Support derived tables in joins
> -------------------------------
>
> Key: PHOENIX-927
> URL: https://issues.apache.org/jira/browse/PHOENIX-927
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Maryann Xue
> Assignee: Maryann Xue
> Labels: enhancement
> Fix For: 3.0.0, 4.0.0, 5.0.0
>
> Original Estimate: 240h
> Remaining Estimate: 240h
>
> Support grammar like:
> SELECT a.col1, b.col2, c.col3 FROM
> (SELECT rk, col1 FROM table1 WHERE col1 LIKE 'foo%' AND col300 IS NULL) AS a
> JOIN (SELECT rk, col2 FROM table2 WHERE col2 LIKE 'bar%') AS b ON a.rk=b.rk
> JOIN (SELECT rk, col3 FROM table3 ) AS c ON a.rk=c.rk;
--
This message was sent by Atlassian JIRA
(v6.2#6252)