Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/12016 )
Change subject: IMPALA-7915: Wrap SQL parser to avoid redundant code ...................................................................... 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 <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- A fe/src/main/java/org/apache/impala/analysis/Parser.java M fe/src/main/java/org/apache/impala/catalog/Type.java M fe/src/main/java/org/apache/impala/catalog/View.java M fe/src/main/java/org/apache/impala/service/Frontend.java M fe/src/test/java/org/apache/impala/analysis/ParserTest.java M fe/src/test/java/org/apache/impala/analysis/StmtMetadataLoaderTest.java M fe/src/test/java/org/apache/impala/common/FrontendTestBase.java M fe/src/test/java/org/apache/impala/service/JdbcTest.java M tests/shell/test_shell_interactive.py 9 files changed, 95 insertions(+), 62 deletions(-) Approvals: Impala Public Jenkins: Looks good to me, approved; Verified -- To view, visit http://gerrit.cloudera.org:8080/12016 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I174c59d38542ff311c6c3dc10cf3ad4e40f8b30e Gerrit-Change-Number: 12016 Gerrit-PatchSet: 6 Gerrit-Owner: Paul Rogers <[email protected]> Gerrit-Reviewer: Bharath Vissapragada <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Paul Rogers <[email protected]>
