zoukankan      html  css  js  c++  java
  • Hive 空指针(NPE)异常

    空指针NullPointerException

    1 Hive之前的一些BUG

    • [HIVE-9430] - NullPointerException on ALTER TABLE ADD PARTITION if no value given

    意思是当为分区表增加新的分区的时候必须指定分区的值

    Wrong : ALTER TABLE xxx ADD PARTITION (yyy)

    Right   : ALTER TABLE xxx ADD PARTITION (yyy='newPartition') 

    • [HIVE-9623] - NullPointerException in MapJoinOperator.processOp(MapJoinOperator.java:253) for TPC-DS Q75 against un-partitioned schema

     

    • [HIVE-9975] - Renaming a nonexisting partition should not throw out NullPointerException

    意思是 query一张分区表的分区字段的值不存在 比如 partition_column='notExistPartition'

    • [HIVE-10437] - NullPointerException on queries where map/reduce is not involved on tables with partitions

    意思是  一张分区表,当你要query这张表的时候,如果是起的mapreduce任务来读表那么不会有任何问题,但是如果是直接从HDFS读取数据那么就会产生NPE问题。具体原因与序列化有关。

    2 其他经常碰到的问题主要是

    • 使用了没有定义的非默认的函数变量, 比如row_number并非是hive的默认函数变量,hive自定义的函数是org.apache.hadoop.hive.ql.udf.generic.GenericUDAFRowNumber , 如果想使用这个函数则需要定义函数变量 create temporary function row_number as 'org.apache.hadoop.hive.ql.udf.generic.GenericUDAFRowNumber'; 当然函数变量row_number的名称是可以随意取,只要不是保留的关键字即可。
    • 一些语法错误

    我是有底线的!

  • 相关阅读:
    用Creator实现一个擀面的效果
    游戏开发中的多语言处理
    Docker(六)容器数据卷
    Docker(五)Docker镜像讲解
    Docker(四)Docker镜像安装
    Docker(三)Docker常用命令
    Docker(二)Docker配置
    nginx 与 tomcat 组合搭建web服务
    Zookeeper 使用
    tomcat-manager 设置
  • 原文地址:https://www.cnblogs.com/benchen/p/5916429.html
Copyright © 2011-2022 走看看