【问题标题】:Not able to create HIVE table with JSON format using SERDE无法使用 SERDE 创建 JSON 格式的 HIVE 表
【发布时间】:2013-05-02 07:46:31
【问题描述】:

我们对 Hadoop 和 Hive 非常陌生。我们创建了普通的 Hive 表并加载了数据。但是当我们使用 JSON 格式在 Hive 中创建表时,我们遇到了问题。我也添加了 serde jar。我们得到以下错误:

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。

【问题讨论】:

  • 您是否将hive-contrib-*.jar 添加到hive.aux.jars.path
  • 我也添加了jar路径.. HIVE_AUX_JARS_PATH=/usr/local/hadoop/hive-0.9.0/lib

标签: hadoop hive


【解决方案1】:

如我所见。您正在使用 hive 的本机表。因此,在这种情况下,您需要加载表中的数据。如果您不想加载数据,则只需将该特定位置的路径放在表创建脚本中。所以,我认为你错过了关键字“EXTERNAL”再次创建这样的表。创建外部表airline_tables(blah blah.....)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多