[
https://issues.apache.org/jira/browse/IMPALA-9921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153239#comment-17153239
]
ASF subversion and git services commented on IMPALA-9921:
---------------------------------------------------------
Commit 3b820d777442dbec244a924604f47952479c2fff in impala's branch
refs/heads/master from stiga-huang
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=3b820d7 ]
IMPALA-9921: Change error messages in checking needsQuotes to TRACE level logs
Impala planner uses the HiveLexer to check whether an ident needs to be
quoted in toSql results. However, HiveLexer will print error messages to
stderr which is redirected to impalad.ERROR, so they appear as ERROR
level logs. Actually, they just mean HiveLexer can't parse the ident so
they are not Hive keywords so don't need to be quoted. These error
messages don't mean anything wrong so shouldn't be ERROR level logs.
This patch overrides the HiveLexer used in ToSqlUtils to log the error
messages to TRACE level logs.
Tests
* Manually verify the error messages don't appear in impalad.ERROR and
are printed to TRACE level logs.
Change-Id: I0e1b5d2963285dc9125d8e0b8ed25c4db6821e0b
Reviewed-on: http://gerrit.cloudera.org:8080/16146
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> Parse errors in ToSqlUtils.hiveNeedsQuotes should not be printed to
> impalad.ERROR
> ---------------------------------------------------------------------------------
>
> Key: IMPALA-9921
> URL: https://issues.apache.org/jira/browse/IMPALA-9921
> Project: IMPALA
> Issue Type: Improvement
> Components: Frontend
> Reporter: Quanlong Huang
> Assignee: Quanlong Huang
> Priority: Critical
>
> Impala planner will check whether an ident needs to be quoted in toSql
> outputs by using the HiveLexer (org.apache.hadoop.hive.ql.parse.HiveLexer).
> However, when there are parse errors from HiveLexer, the error messages will
> be printed to stderr which is redirected to impalad.ERROR. Actually, these
> error messages only means the ident needs to be quoted. They should have a
> lower log level and shouldn't be printed to impalad.ERROR.
> A possible solution is to extend HiveLexer and override the
> displayRecognitionError() as HiveLexerX does. We can also consider using
> HiveLexerX directly.
> *Reproduction*
> {code:java}
> impala-shell> select 'hello' as `你好`;
> {code}
> Some error messages are printed in impalad.ERROR:
> {code:java}
> line 1:0 no viable alternative at character '你'
> line 1:1 no viable alternative at character '好'
> line 1:0 no viable alternative at character '你'
> line 1:1 no viable alternative at character '好'
> line 1:0 no viable alternative at character '你'
> line 1:1 no viable alternative at character '好'
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]