使用 Elephant Bird jsonLoader 时 Pig Job 挂起
Pig Job hangs when using Elephant Bird jsonLoader
这是
的延续
我的新猪脚本是:
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
我将 jars 移动到完全相同位置的所有数据节点。我不确定还有什么地方可以检查。有人可以指点一下吗?
你到处都缺少 ;
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';
我的机器出了点问题,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
我将 jars 移动到完全相同位置的所有数据节点。我不确定还有什么地方可以检查。有人可以指点一下吗?
你到处都缺少 ;
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';
我的机器出了点问题,pig 没问题。我重新启动了机器,一切顺利。