码迷,mamicode.com
首页 > 其他好文 > 详细

hive如何使用中文查询条件

时间:2014-05-01 04:26:42      阅读:415      评论:0      收藏:0      [点我收藏+]

标签:com   http   blog   class   div   code   c   java   log   t   sp   

直接在hql中使用中文会报错:
org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.RuntimeException: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
        at org.apache.hadoop.mapred.JobTracker.submitJob(JobTracker.java:3759)
        at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:557)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1416)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1412)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:396)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1115)
        at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1410)
Caused by: java.lang.RuntimeException: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
        at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1387)
        at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1261)
        at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:1192)
        at org.apache.hadoop.conf.Configuration.get(Configuration.java:415)
        at org.apache.hadoop.mapred.JobConf.checkAndWarnDeprecation(JobConf.java:1957)
        at org.apache.hadoop.mapred.JobConf.<init>(JobConf.java:386)
        at org.apache.hadoop.mapred.JobInProgress.<init>(JobInProgress.java:413)
        at org.apache.hadoop.mapred.JobTracker.submitJob(JobTracker.java:3757)
        ... 10 more

 

受文章http://superlxw1234.iteye.com/blog/1622414

“用java中匹配中文的正则即可:

Sql代码 
1
name rlike ‘^[\\u4e00-\\u9fa5]+$‘ 
”的启发,使用unicode码(反斜线需转义):province rlike ‘^(\\u5317\\u4eac|\\u5929\\u6d25)‘

hive如何使用中文查询条件,布布扣,bubuko.com

hive如何使用中文查询条件

标签:com   http   blog   class   div   code   c   java   log   t   sp   

原文地址:http://www.cnblogs.com/aprilrain/p/3702006.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!