Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-9921

Parse errors in ToSqlUtils.hiveNeedsQuotes should not be printed to impalad.ERROR

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • Impala 2.8.0, Impala 2.9.0, Impala 2.10.0, Impala 2.11.0, Impala 3.0, Impala 2.12.0, Impala 3.1.0, Impala 3.2.0, Impala 3.3.0, Impala 3.4.0
    • Impala 4.0.0, Impala 3.4.1
    • Frontend
    • None
    • ghx-label-9

    Description

      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

      impala-shell> select 'hello' as `你好`;
      

      Some error messages are printed in impalad.ERROR:

      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 '好'
      

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            stigahuang Quanlong Huang
            stigahuang Quanlong Huang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment