You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Hongze Zhang (JIRA)" <ji...@apache.org> on 2019/04/12 10:47:00 UTC

[jira] [Updated] (CALCITE-2993) ParseException may be thrown for legal SQL queries due to incorrect "LOOKAHEAD(1)" hints

     [ https://issues.apache.org/jira/browse/CALCITE-2993?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hongze Zhang updated CALCITE-2993:
----------------------------------
    Description: 
In some cases, ParseException is thrown incorrectly:

Case 1
{code:sql}
select lead(x) ignore from t -- "ignore" aliases "lead(x)"
{code}
Case 2
{code:sql}
select *
  from t match_recognize
  (
     after match skip to last -- "last" is a column name. This is the implicit form of "skip to last last"
    pattern (strt down+ up+)
    define
      down as down.price < PREV(down.price),
      up as up.price > prev(up.price)
  ) mr
{code}
Case 3
{code:sql}
select json_object(key: value) from t -- "key"/"value" are both column names.
{code}
And the failure on Case 1 is introduced by the fix of CALCITE-2847, Case 2/3 are not.

  was:
In some cases, ParseException is thrown incorrectly:

Case 1
{code:sql}
select lead(x) ignore from t
{code}

Case 2 
{code:sql}
select *
  from t match_recognize
  (
     after match skip to last
    pattern (strt down+ up+)
    define
      down as down.price < PREV(down.price),
      up as up.price > prev(up.price)
  ) mr
{code}

Case 3
{code:sql}
select json_object(key: value) from t
{code}

And the failure on Case 1 is introduced by the fix of CALCITE-2847, Case 2/3 are not.



> ParseException may be thrown for legal SQL queries due to incorrect "LOOKAHEAD(1)" hints
> ----------------------------------------------------------------------------------------
>
>                 Key: CALCITE-2993
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2993
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Hongze Zhang
>            Assignee: Hongze Zhang
>            Priority: Major
>             Fix For: 1.20.0
>
>
> In some cases, ParseException is thrown incorrectly:
> Case 1
> {code:sql}
> select lead(x) ignore from t -- "ignore" aliases "lead(x)"
> {code}
> Case 2
> {code:sql}
> select *
>   from t match_recognize
>   (
>      after match skip to last -- "last" is a column name. This is the implicit form of "skip to last last"
>     pattern (strt down+ up+)
>     define
>       down as down.price < PREV(down.price),
>       up as up.price > prev(up.price)
>   ) mr
> {code}
> Case 3
> {code:sql}
> select json_object(key: value) from t -- "key"/"value" are both column names.
> {code}
> And the failure on Case 1 is introduced by the fix of CALCITE-2847, Case 2/3 are not.



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