You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Danny Chan (JIRA)" <ji...@apache.org> on 2019/06/28 02:14:00 UTC

[jira] [Updated] (CALCITE-3152) Unify throws in sql parser

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

Danny Chan updated CALCITE-3152:
--------------------------------
    Environment:     (was: {color:#333333}Copied from DEV mail,{color}

{color:#333333}Now our parser has 3 kinds of throws behavior:

[1] Use JavaCC generateParseException
[2] Use SqlUtil.newContextException
[3] Use JavaCC ParseExecption directly

For [1] and [2] there is a position info in the exception message, a throw may like:{color}
{code:java}
From line 1, column 15 to line 1, column 26:
{code}
{color:#333333}{color:#333333}But for 3, we only have the error message without position info, which is not that user friendly when the sql text is huge (there are 10 occurance for 3 in our parser). So shall we unify them ? E.G. Use only 1 and 2 is enough for all the cases, the 2 can totally replace 3.{color}{color}

{color:#333333}{color:#333333}{color:#333333}[1] [https://github.com/apache/calcite/blob/69c8053cd98ec65c55fa1c3b282b076536ab758f/core/src/main/codegen/templates/Parser.jj#L4494]
[2] [https://github.com/apache/calcite/blob/69c8053cd98ec65c55fa1c3b282b076536ab758f/core/src/main/codegen/templates/Parser.jj#L386]
[3] [https://github.com/apache/calcite/blob/69c8053cd98ec65c55fa1c3b282b076536ab758f/core/src/main/codegen/templates/Parser.jj#L601]{color}{color}{color})

> Unify throws in sql parser
> --------------------------
>
>                 Key: CALCITE-3152
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3152
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.20.0
>            Reporter: Danny Chan
>            Assignee: Danny Chan
>            Priority: Major
>             Fix For: 1.21.0
>
>




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