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

ASF subversion and git services commented on IMPALA-7915:
---------------------------------------------------------

Commit 282199a5ab89b9850213fb21ecb341727fa8a090 in impala's branch 
refs/heads/master from [~paul-rogers]
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=282199a ]

IMPALA-7915: Wrap SQL parser to avoid redundant code

The FE has several repeated blocks of code to set up the lexer and
parser, to parse, and to handle errors. This patch moves 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, declares
that as the return value of the new static method to clearly state the
actual output.

Testing: This is just a refactoring. Reran all FE tests to ensure no
regressions.

Change-Id: I174c59d38542ff311c6c3dc10cf3ad4e40f8b30e
Reviewed-on: http://gerrit.cloudera.org:8080/12016
Reviewed-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>


> 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 several 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-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to