• hive如何使用中文查询条件


    直接在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代码 
        name rlike '^[\u4e00-\u9fa5]+$'  
    
    ”的启发,使用unicode码(反斜线需转义):province rlike '^(\u5317\u4eac|\u5929\u6d25)'
  • 相关阅读:
    2020/1/27 代码审计学习-宽字节注入与二次注入
    2020/1/27代码审计学习之SQL注入漏洞
    2020/1/27代码审计学习之审计涉及的超全局变量
    2019总结与最近
    鸽一天
    [极客大挑战 2019]Knife
    [LuoguP1438]无聊的数列(差分+线段树/树状数组)
    [BJWC2018]最长上升子序列
    笙上月
    笔下梅
  • 原文地址:https://www.cnblogs.com/aprilrain/p/3702006.html
Copyright © 2020-2023  润新知