java 无法验证 serde:org.openx.data.jsonserde.jsonserde
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26644351/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cannot validate serde : org.openx.data.jsonserde.jsonserde
提问by deepthi toopran
I have written this query to create a table on hive. My data is initially in json format, so i have downloaded and build serde and added all jar required for it to run. But i am getting the following error:
我编写了这个查询来在 hive 上创建一个表。我的数据最初是 json 格式,所以我已经下载并构建了 serde 并添加了它运行所需的所有 jar。但我收到以下错误:
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Cannot validate serde: org.openx.data.jsonserde.JsonSerDe
QUERY:
询问:
create table tip(type string,
text string,
business_id string,
user_id string,
date date,
likes int)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES("date.mapping"="date")
STORED AS TEXTFILE;
回答by Vinkal
I too encountered this problem. In my case, I managed to fix this issue by adding json-serde-1.3.7-SNAPSHOT-jar-with-dependencies.jar
at hive
command prompt as shown below:
我也遇到了这个问题。就我而言,我设法通过json-serde-1.3.7-SNAPSHOT-jar-with-dependencies.jar
在hive
命令提示符处添加来解决此问题,如下所示:
hive> ADD JAR /usr/local/Hive-JSON-Serde/json-serde/target/json-serde-1.3.7-SNAPSHOT-jar-with-dependencies.jar;
Below are the steps I have followed on Ubuntu 14.04:
以下是我在 Ubuntu 14.04 上遵循的步骤:
1. Fire up Linux terminal and cd /usr/local
2. sudo git clone https://github.com/rcongiu/Hive-JSON-Serde.git
3. sudo mvn -Pcdh5 clean package
4. The serde file will be in
/usr/local/Hive-JSON-Serde/json-serde/target/json-serde-1.3.7-SNAPSHOT-jar-with-dependencies.jar
5. Go to hive prompt and ADD JAR file as shown in Step 6.
6. hive> ADD JAR /usr/local/Hive-JSON-Serde/json-serde/target/json-serde-1.3.7- SNAPSHOT-jar-with-dependencies.jar;
7. Now create hive table from hive> prompt. At this stage, Hive table should be created successfully without any error.
Hive
Version: 1.2.1
Hive
版本:1.2.1
Hadoop
Version: 2.7.1
Hadoop
版本:2.7.1
Reference: Hive-JSON-Serde
回答by jandoubi chaima
You have to build the project cloned using the maven !
您必须构建使用 maven 克隆的项目!
mvn install in the directory /path/directory/Hive-JSON-Serd here we are in /usr/local
mvn 安装在目录 /path/directory/Hive-JSON-Serd 这里我们在 /usr/local