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

Hongze Zhang commented on CALCITE-35:
-------------------------------------

Thanks for the PR [~mgelbana]! I just took a quick look at the changes, which 
seems to be reasonable but still not able to solve the documented problem[1] of 
difficulty on setting correct lookahead for table references. I see Julian has 
also mentioned the problem in previous comments.

To figure out the problem in the fix, I suggest to add a test case like 
following:

{code:sql}
SELECT * FROM (((SELECT * FROM tab)))
{code}

or even more left brackets:

{code:sql}
SELECT * FROM ((((((((((SELECT * FROM tab))))))))))
{code}

Generally these cases should be parsed successfully before and after applying 
the fix.

[1] 
https://github.com/apache/calcite/blob/b15c8c9baccf05e1bf16b1e268d4edfac90bbf03/core/src/main/codegen/templates/Parser.jj#L339-L348

> Support parenthesized sub-clause in JOIN
> ----------------------------------------
>
>                 Key: CALCITE-35
>                 URL: https://issues.apache.org/jira/browse/CALCITE-35
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.19.0
>            Reporter: GitHub Import
>            Priority: Major
>              Labels: github-import, pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> SQL-92 allows joins to be grouped into trees using parentheses. For example,
>   select * from a join (b join c on b.x = c.x) on a.y = c.y
> Optiq should support this. Currently this gives 
> "org.eigenbase.util.EigenbaseException: Non-query expression encountered in 
> illegal context".
> ---------------- Imported from GitHub ----------------
> Url: https://github.com/julianhyde/optiq/issues/35
> Created by: [julianhyde|https://github.com/julianhyde]
> Labels: 
> Created at: Fri Apr 19 02:46:01 CEST 2013
> State: open



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to