Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/incubator-phoenix/pull/28#discussion_r11556731
  
    --- 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 --
    
    Does the simple non-join case also work?
    
        SELECT * FROM (SELECT * FROM t)
    
    Would be good to have a basic test case for this as well. Also, as long as 
your not doing nested aggregate queries, it would not be too difficult to 
support something like this:
    
        SELECT * FROM (SELECT * FROM t LIMIT 5) ORDER BY foo;
    
    This is the use case where you want to use nested queries to change the 
default processing order of the clauses.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to