gpt4 book ai didi

json - 在配置单元中配置对象时出错

转载 作者:可可西里 更新时间:2023-11-01 16:31:43 27 4
gpt4 key购买 nike

我正在尝试使用推文和 hadoop 中的配置单元制作一个情感分析项目。我在 tweets json 格式之上创建了一个表,我可以在查询 SELECT * FROM TWEETS 后查看推文;然后我创建了以下 View ,但这不是在查询中检索数据 Select * from tweet_simple;

hive> CREATE VIEW tweets_simple AS
> SELECT
> id,
> cast ( from_unixtime( unix_timestamp(concat( '2014 ', substring(created_at,5,15)), 'yyyy MMM dd hh:mm:ss')) as timestamp) ts,
> text,
> user.time_zone
> FROM tweets;
OK
Time taken: 0.949 seconds

hive> Select * from tweets_simple limit 10;


Total MapReduce jobs = 1
Launching Job 1 out of 1
Number of reduce tasks is set to 0 since there's no reduce operator
Starting Job = job_201503010134_0001, Tracking URL = http://master:50030/jobdetails.jsp?jobid=job_201503010134_0001
Kill Command = /usr/lib/hadoop/bin/hadoop job -kill job_201503010134_0001
Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 0
2015-03-01 02:21:28,124 Stage-1 map = 0%, reduce = 0%
2015-03-01 02:22:25,083 Stage-1 map = 100%, reduce = 100%
Ended Job = job_201503010134_0001 with errors
Error during job, obtaining debugging information...
Job Tracking URL: http://master:50030/jobdetails.jsp?jobid=job_201503010134_0001
Examining task ID: task_201503010134_0001_m_000002 (and more) from job job_201503010134_0001


Task with the most failures(4):
-----
Task ID:
task_201503010134_0001_m_000000

URL:
http://master:50030/taskdetails.jsp?jobid=job_201503010134_0001& tipid=task_201503010134_0001_m_000000
-----
Diagnostic Messages for this Task:
java.lang.RuntimeException: Error in configuring object
at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:413)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:332)
at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.jav a:1438)
at org.apache.hadoop.mapred.Child.main(Child.java:262)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja

FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask
MapReduce Jobs Launched:
Job 0: Map: 1 HDFS Read: 0 HDFS Write: 0 FAIL
Total MapReduce CPU Time Spent: 0 msec

最佳答案

数据是 json 格式。你已经在数据之上创建了表,所以每次查询数据时,它都需要反序列化器将 josn 数据解释为 hive 支持的数据格式。所以在运行查询之前添加 jar 作为:

添加 JAR/usr/lib/hive/lib/hive-serdes-1.0-SNAPSHOT.jar;

这个 jar 有 JSONSerDe.class 反序列化 JSON 对象。

关于json - 在配置单元中配置对象时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28793005/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com