Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-25677

HiveParser cannot parse a sql with chinese

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      I hope someone can help me。

      I write a program to parse the HQL. My code is as follows

      try {
       String mySql = "SELECT a,b,c as `中国` from tbl"
       ASTNode ast = ParseUtils.parse(mySql);
       ...
      } catch (Exception e) {
       LOG.info("parse_sql exception: {}", e.getMessage()); 
       ...
      }
      

       It will print the log:

       

      parse_sql exception: line 1:21 cannot recognize input near 'as' 'from' 'tbl' in selection target
      

       

       

      The following code can run correctly

      String mySql = "SELECT a,b,c as `china` from tbl"
      

      Thanks very much.

      Attachments

        Activity

          People

            dengzh Zhihua Deng
            mysid2018 mysid2018
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: