hive1.2以前版本的where条件NullPointerException

1、异常背景:

hive版本1.1.0,表是orc格式,使用条件where name in ('支付金额','订单量','客单价','毛利率','全链路达成率','猫超重点商品在架率','基准价毛利率','商品缺货率')

2、日志如下:

Diagnostic Messages for this Task:
Error: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row 
    at org.apache.hadoop.hive.ql.exec.mr.ExecMapper.map(ExecMapper.java:179)
    at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54)
    at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:453)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
    at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1693)
    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row 
    at org.apache.hadoop.hive.ql.exec.vector.VectorMapOperator.process(VectorMapOperator.java:52)
    at org.apache.hadoop.hive.ql.exec.mr.ExecMapper.map(ExecMapper.java:170)
    ... 8 more
Caused by: java.lang.NullPointerException
    at org.apache.hadoop.hive.ql.exec.vector.expressions.CuckooSetBytes.rehash(CuckooSetBytes.java:222)
    at org.apache.hadoop.hive.ql.exec.vector.expressions.CuckooSetBytes.insert(CuckooSetBytes.java:118)
    at org.apache.hadoop.hive.ql.exec.vector.expressions.CuckooSetBytes.load(CuckooSetBytes.java:127)
    at org.apache.hadoop.hive.ql.exec.vector.expressions.FilterStringColumnInList.evaluate(FilterStringColumnInList.java:71)
    at org.apache.hadoop.hive.ql.exec.vector.VectorFilterOperator.processOp(VectorFilterOperator.java:100)
    at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:815)
    at org.apache.hadoop.hive.ql.exec.TableScanOperator.processOp(TableScanOperator.java:95)
    at org.apache.hadoop.hive.ql.exec.MapOperator$MapOpCtx.forward(MapOperator.java:157)
    at org.apache.hadoop.hive.ql.exec.vector.VectorMapOperator.process(VectorMapOperator.java:45)
    ... 9 more

3、查看1.1.0版本源码:

    if (prev1 == null) {
      prev1 = t1;
      prev1 = t2;
    }
    t1 = new byte[n][];
    t2 = new byte[n][];
    for (byte[] v  : prev1) {
      if (v != null) {
        byte[] x = tryInsert(v);
        if (x != null) {
          rehash();
          return;
        }
      }
    }
    for (byte[] v  : prev2) {
      if (v != null) {

发现prev2没有初始化,而prev1初始化两次,应该是bug

4、发现官网咋1.2版本fix了,参照https://issues.apache.org/jira/browse/HIVE-9950



你可能感兴趣的:(hadoop)