[英]Json Data on hive
I am trying to read json data using Hive External table but I am getting Null pointer exception while using json serde.. 我正在尝试使用Hive外部表读取json数据,但是在使用json serde时却出现了Null指针异常。
Below is the table command and error: 下面是表命令和错误:
hive> create external table json_tab
> (
> name string, age string, passion string
> )
> row format SERDE 'org.apache.hadoop.hive.contrib.serde2.JsonSerde' location '/home/pandi/hive_in';
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.NullPointerException
I have added below jar as well: add jar /usr/local/apache-hive-2.1.1-bin/lib/hive-contrib-2.1.1.jar; 我还添加了下面的jar:添加jar /usr/local/apache-hive-2.1.1-bin/lib/hive-contrib-2.1.1.jar; add jar /usr/local/apache-hive-2.1.1-bin/lib/hive-json-serde.jar;
添加jar /usr/local/apache-hive-2.1.1-bin/lib/hive-json-serde.jar;
Please help. 请帮忙。
It looks like an issue with the SerDe class. 看起来好像是SerDe类的问题。
Try to make use of this implementation: 'org.apache.hive.hcatalog.data.JsonSerDe' present in hive-hcatalog-core-0.13.0.jar; 尝试利用此实现:hive-hcatalog-core-0.13.0.jar中存在“ org.apache.hive.hcatalog.data.JsonSerDe”;
This works for me. 这对我有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.