2013-05-08 72 views
1

我們對Hadoop和Hive非常新穎。我們也創建了普通的Hive表和加載數據。但是,當我們使用JSON格式在Hive中創建表時,我們正面臨着問題。我還添加了serde jar。我們得到以下錯誤:無法使用SERDE創建JSON格式的HIVE表格

create table airline_tables(Airline string,Airlineid string,Sourceairport string,Sourceairportid string,Destinationairport string,`Destinationairportid string,Codeshare string,Stop string,Equipment String)` ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.JsonSerde'`location '/home/hduser/part-000';` 

FAILED: Error in metadata: java.lang.NullPointerException 
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask 

位置是HDFS。 我使用的是Hive-0.9.0和hadoop 1.0.1。

+0

您是否將'hive-contrib - *。jar'添加到'hive.aux.jars.path'? – pensz 2013-05-09 16:13:42

+0

我也添加了jar路徑。HIVE_AUX_JARS_PATH =/usr/local/hadoop/hive-0.9.0/lib – user2361032 2013-05-13 04:41:01

回答

2

正如我所見。您正在使用配置單元的本地表。所以在這種情況下,你需要在表格中加載數據。如果您不想加載數據,那麼您只需將該特定位置的路徑放在表創建腳本中即可。所以,我想你錯過了關鍵字「EXTERNAL」再次創建這樣的表。創建外部表airline_tables(等等等等.....)