gpt4 book ai didi

json - 使用Elephant Bird jsonLoader时Pig Job挂起

转载 作者:行者123 更新时间:2023-12-02 21:11:32 25 4
gpt4 key购买 nike

这是this的延续

我的新 pig 脚本是:

register /usr/hdp/current/pig-client/lib/piggybank.jar
register /opt/elephantbird-jars/elephant-bird-core-4.5.jar
register /opt/elephantbird-jars/elephant-bird-hadoop-compat-4.5.jar
register /opt/elephantbird-jars/elephant-bird-pig-4.5.jar
register /opt/elephantbird-jars/json-simple-1.1.1.jar

data_input = LOAD 'local/path/for/hdfs/files' USING com.twitter.elephantbird.pig.load.JsonLoader() AS (json:map[]);

x = FOREACH data_input GENERATE json#'actor__id' AS actor_id, json#'actor__image__url' AS actor_image_url, json#'actor__displayName' AS actor_displayname, json#'actor__verification__adHocVerified' AS actor_verification, json#'actor__url' AS actor_url;

STORE x INTO '/tmp/user_posts' USING JsonStorage();

此代码在本地模式下工作: pig -x local user_posts.pig
但是它在mapreduce模式下失败: pig -x mapreduce user_posts.pig
我将 jar 移到了完全相同位置的所有数据节点。我不确定还有什么地方可以检查。有人可以指点一下吗?

最佳答案

你到处都缺少;

REGISTER '/me/home/elephant-bird-core-4.12.jar';
REGISTER '/me/home/elephant-bird-pig-4.12.jar';
REGISTER '/me/home/elephant-bird-hadoop-compat-4.12.jar';

关于json - 使用Elephant Bird jsonLoader时Pig Job挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40158093/

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