首页 > 其他 > 详细

hive如何使用中文查询条件

时间:2014-05-01 04:27:14      阅读:958      评论:0      收藏:0      [点我收藏+]

直接在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如何使用中文查询条件

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!