You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Zhihua Deng (Jira)" <ji...@apache.org> on 2021/11/22 07:16:00 UTC

[jira] [Assigned] (HIVE-25677) HiveParser cannot parse a sql with chinese

     [ https://issues.apache.org/jira/browse/HIVE-25677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zhihua Deng reassigned HIVE-25677:
----------------------------------

    Assignee: Zhihua Deng

> HiveParser cannot parse a sql with chinese
> ------------------------------------------
>
>                 Key: HIVE-25677
>                 URL: https://issues.apache.org/jira/browse/HIVE-25677
>             Project: Hive
>          Issue Type: Bug
>            Reporter: mysid2018
>            Assignee: Zhihua Deng
>            Priority: Major
>
> {color:#cc7832}I hope someone can help me。{color}
> {color:#cc7832}I write a program to parse the HQL. {color}{color:#cc7832}My code is as follows{color}
> {code:java}
> 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()); 
>  ...
> }
> {code}
>  It will print the log: 
>  
> {code:java}
> parse_sql exception: line 1:21 cannot recognize input near 'as' 'from' 'tbl' in selection target
> {code}
>  
>  
> The following code can run correctly
> {code:java}
> String mySql = "SELECT a,b,c as `china` from tbl"
> {code}
> Thanks very much.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)