You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Quanlong Huang (Jira)" <ji...@apache.org> on 2020/07/07 01:47:00 UTC

[jira] [Created] (IMPALA-9921) Parse errors in ToSqlUtils.hiveNeedsQuotes should not be printed to impalad.ERROR

Quanlong Huang created IMPALA-9921:
--------------------------------------

             Summary: 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


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)