Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

PIG ERRO execution

avatar
Master Collaborator

Hi:

i am executing this scrpit and iam getting this error, anny suggestion??

register /usr/lib/elephant-bird-pig-3.0.5.jar
register /usr/lib/json-simple.jar


A = LOAD '/user/dangulo/Log.json.txt' USING com.twitter.elephantbird.pig.load.JsonLoader('-nestedLoad');
dump A;
2016-02-11 17:49:51,155 [main] INFO  org.apache.hadoop.mapred.ClientServiceDelegate - Application state is completed. FinalApplicationStatus=FAILED. Redirecting to job history server
2016-02-11 17:49:51,333 [main] ERROR org.apache.pig.tools.pigstats.PigStats - ERROR 0: org.apache.pig.backend.executionengine.ExecException: ERROR 2997: Unable to recreate exception from backed error: Error: Found interface org.apache.hadoop.mapreduce.Counter, but class was expected
2016-02-11 17:49:51,333 [main] ERROR org.apache.pig.tools.pigstats.mapreduce.MRPigStatsUtil - 1 map reduce job(s) failed!
2016-02-11 17:49:51,335 [main] INFO  org.apache.pig.tools.pigstats.mapreduce.SimplePigStats - Script Statistics: 
1 ACCEPTED SOLUTION

avatar
Master Mentor
@Roberto Sancho

Hi Roberto, Please see this...Simple google search led to this thread http://stackoverflow.com/questions/17879259/loading-data-from-hdfs-does-not-work-with-elephantbird

This is indeed a versioning problem: some libraries are not yet compatible with the new MapReduce API, see for example the issues #56, #247 and #308. For ElephantBird the issue issolved in a recent version. Using ElephantBird 4.1 in the above code and adding the Hadoop compatibility module

register 'lib/elephant-bird-core-4.1.jar';
register 'lib/elephant-bird-pig-4.1.jar';
register 'lib/elephant-bird-hadoop-compat-4.1.jar';
register 'lib/google-collections-1.0.jar';
register 'lib/json-simple-1.1.jar';

solved the problem! 🙂

View solution in original post

4 REPLIES 4

avatar
Master Mentor

@Roberto Sancho I'm guessing your elephant bird library is compiled for Hadoop 1.x line. See if they offer Hadoop 2 compiled jar. Why not use https://pig.apache.org/docs/r0.15.0/func.html#jsonloadstore

?

avatar
Master Mentor

@Roberto Sancho https://github.com/twitter/elephant-bird/wiki/Hadoop-2.x-Support

So you might have an old jar? Still try built-in jsonloader instead but confirm my answer.

avatar
Master Mentor
@Roberto Sancho

Hi Roberto, Please see this...Simple google search led to this thread http://stackoverflow.com/questions/17879259/loading-data-from-hdfs-does-not-work-with-elephantbird

This is indeed a versioning problem: some libraries are not yet compatible with the new MapReduce API, see for example the issues #56, #247 and #308. For ElephantBird the issue issolved in a recent version. Using ElephantBird 4.1 in the above code and adding the Hadoop compatibility module

register 'lib/elephant-bird-core-4.1.jar';
register 'lib/elephant-bird-pig-4.1.jar';
register 'lib/elephant-bird-hadoop-compat-4.1.jar';
register 'lib/google-collections-1.0.jar';
register 'lib/json-simple-1.1.jar';

solved the problem! 🙂

avatar
Master Collaborator

its worked for me 🙂

The directory for the lib i need to create from HDFS.

Many thanks