简体   繁体   中英

Pig Job hangs when using Elephant Bird jsonLoader

This is in continuation to this

My new pig script is:

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();

This code works in local mode: pig -x local user_posts.pig

But it fails in mapreduce mode: pig -x mapreduce user_posts.pig

I moved the jars to all the data nodes in the exact same location. I am not sure where else to check. Can someone please give some pointers?

you are missing the ; everywhere

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';

It was some issue with my machine and not any problem with pig. I rebooted the machine and everything went well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM