phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-71) Support sub-joins
Date Mon, 31 Mar 2014 23:31:15 GMT

    [ https://issues.apache.org/jira/browse/PHOENIX-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13955870#comment-13955870
] 

ASF GitHub Bot commented on PHOENIX-71:
---------------------------------------

Github user jtaylor-sfdc commented on a diff in the pull request:

    https://github.com/apache/incubator-phoenix/pull/23#discussion_r11142260
  
    --- Diff: phoenix-core/src/main/antlr3/PhoenixSQL.g ---
    @@ -629,24 +629,29 @@ parseOrderByField returns [OrderByNode ret]
     
     parseFrom returns [List<TableNode> ret]
     @init{ret = new ArrayList<TableNode>(4); }
    -    :   t=table_ref {$ret.add(t);} (s=sub_table_ref { $ret.add(s); })*
    -    ;
    -    
    -sub_table_ref returns [TableNode ret]
    -    :   COMMA t=table_ref { $ret = t; }
    -    |   t=join_spec { $ret = t; }
    +    :   t=table_ref {$ret.add(t);} (COMMA s=table_ref { $ret.add(s); })*
         ;
     
     table_ref returns [TableNode ret]
    +    : t=single_table_ref p=join_parts { $ret = factory.table(t, p); }
    +    ;
    +
    +single_table_ref returns [TableNode ret]
         :   n=bind_name ((AS)? alias=identifier)? { $ret = factory.bindTable(alias, factory.table(null,n));
} // TODO: review
         |   t=from_table_name ((AS)? alias=identifier)? (LPAREN cdefs=dyn_column_defs RPAREN)?
{ $ret = factory.namedTable(alias,t,cdefs); }
         |   LPAREN SELECT s=hinted_select_node RPAREN ((AS)? alias=identifier)? { $ret =
factory.derivedTable(alias, s); }
         ;
     
    -join_spec returns [TableNode ret]
    -    :   j=join_type JOIN t=table_ref ON e=expression { $ret = factory.join(j, e, t);
}
    -    ;
    +join_parts returns [List<Pair<Pair<JoinTableNode.JoinType, ParseNode>,TableNode>>
ret]
    +@init{ret = new ArrayList<Pair<Pair<JoinTableNode.JoinType, ParseNode>,TableNode>>(4);
}
    +	:	(p=join_part { $ret.add(p); })*
    +	;
     
    +join_part returns [Pair<Pair<JoinTableNode.JoinType, ParseNode>,TableNode>
ret]
    --- End diff --
    
    How about a JoinPartNode instead of nested Pairs?


> Support sub-joins
> -----------------
>
>                 Key: PHOENIX-71
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-71
>             Project: Phoenix
>          Issue Type: New Feature
>    Affects Versions: 3.0.0
>            Reporter: Maryann Xue
>            Assignee: Maryann Xue
>
> Support join table as sub-join. (currently join table can only be a named table)
> For example,
> select * from A left join (B join C on B.bc_id = C.bc_id) on A.ab_id = B.ab_id and A.ac_id
= C.ac_id;



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message