[ https://issues.apache.org/jira/browse/PHOENIX-927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13967299#comment-13967299 ]
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_r11557047 --- Diff: phoenix-core/src/it/java/org/apache/phoenix/end2end/HashJoinIT.java --- @@ -2529,6 +2724,300 @@ public void testSubJoin() throws Exception { conn.close(); } } + + @Test + public void testJoinWithSubquery() throws Exception { + String query1 = "SELECT item.\"item_id\", item.name, supp.sid, supp.name FROM " + JOIN_ITEM_TABLE_FULL_NAME + " item INNER JOIN (SELECT \"supplier_id\" sid, name FROM " + JOIN_SUPPLIER_TABLE_FULL_NAME + " WHERE name BETWEEN 'S1' AND 'S5') AS supp ON item.\"supplier_id\" = supp.sid"; + String query2 = "SELECT item.\"item_id\", item.name, supp.\"supplier_id\", supp.name FROM " + JOIN_ITEM_TABLE_FULL_NAME + " item INNER JOIN (SELECT \"supplier_id\", name FROM " + JOIN_SUPPLIER_TABLE_FULL_NAME + ") AS supp ON item.\"supplier_id\" = supp.\"supplier_id\" AND (supp.name = 'S1' OR supp.name = 'S5')"; --- End diff -- This simple nested query case is not supported yet, for non-join queries going into compileSingleQuery() logic. Will do this in next check-in. > 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)