You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Paul Rogers (JIRA)" <ji...@apache.org> on 2018/11/30 22:56:00 UTC

[jira] [Updated] (IMPALA-7915) Wrap SQL parser to avoid redundant code

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

Paul Rogers updated IMPALA-7915:
--------------------------------
    Description: 
The FE has many repeated blocks of code to set up the lexer and parser, to parse, and to handle errors.

Move this code into a static function that can be used in place of the copies.

At the same time, provide a specific {{ParseException}} to replace the generic {{Exception}} thrown by the parser to allow easier error handling.

Some of the uses of the parser assume the return value is {{Object}}, others that the value is {{ParseNode}} and still others that it is {{StatementBase}}. Since the actual return is {{StatementBase}}, declare that as the return value of the new static method to clearly state the actual output.

  was:
The FE has many repeated blocks of code to set up the lexer and parser, to parse, and to handle errors.

Move this code into a static function that can be used in place of the copies.

At the same time, provide a specific {{ParseException}} to replace the generic {{Exception}} thrown by the parser to allow easier error handling.


> Wrap SQL parser to avoid redundant code
> ---------------------------------------
>
>                 Key: IMPALA-7915
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7915
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Frontend
>    Affects Versions: Impala 3.0
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Minor
>
> The FE has many repeated blocks of code to set up the lexer and parser, to parse, and to handle errors.
> Move this code into a static function that can be used in place of the copies.
> At the same time, provide a specific {{ParseException}} to replace the generic {{Exception}} thrown by the parser to allow easier error handling.
> Some of the uses of the parser assume the return value is {{Object}}, others that the value is {{ParseNode}} and still others that it is {{StatementBase}}. Since the actual return is {{StatementBase}}, declare that as the return value of the new static method to clearly state the actual output.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org