embedded pig error when running on pig 15 on Hadoop 2

2015-08-14T06:21:15

Whenever i run any apache pig code from the terminal everythig goes well and i get the result. So i conclude that my installation for Pig 0.15.0 and Hadoop 2.7.0 is alright. The problem is when i run the pigServer from inside java code:

 PigServer pigServer = new PigServer(ExecType.MAPREDUCE, conf);
 pigServer.setBatchOn();
 pigServer.debugOff();
 pigServer.setJobName(JobId);
 pigServer.registerScript(scriptUrl, params);
 pigServer.executeBatch();

My maven dependencies are:

        <dependency>
            <groupId>org.apache.pig</groupId>
            <artifactId>pig</artifactId>
            <version>0.15.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-client</artifactId>
            <version>2.7.0</version>
        </dependency>

I get the following error.

WARN  org.apache.pig.backend.hadoop20.PigJobControl - falling back to default JobControl (not using hadoop 0.20 ?)
java.lang.NoSuchFieldException: runnerState
    at java.lang.Class.getDeclaredField(Class.java:1948)
    at org.apache.pig.backend.hadoop20.PigJobControl.<clinit>(PigJobControl.java:51)
    at org.apache.pig.backend.hadoop.executionengine.shims.HadoopShims.newJobControl(HadoopShims.java:100)
    at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.compile(JobControlCompiler.java:313)
    at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:199)
    at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.launchPig(HExecutionEngine.java:277)
    at org.apache.pig.PigServer.launchPlan(PigServer.java:1367)
    at org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1352)
    at org.apache.pig.PigServer.execute(PigServer.java:1341)
    at org.apache.pig.PigServer.executeBatch(PigServer.java:392)
    at org.apache.pig.PigServer.executeBatch(PigServer.java:375)
    at org.apache.pig.tools.grunt.GruntParser.executeBatch(GruntParser.java:170)
    at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:232)
    at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:203)
    at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:81)
    at org.apache.pig.Main.run(Main.java:479)

I used to run the above code on Hadoop 1 and it was working but now it is not.

Copyright License:
Author:「Abdulrahman」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/31999398/embedded-pig-error-when-running-on-pig-15-on-hadoop-2

About “embedded pig error when running on pig 15 on Hadoop 2” questions

Whenever i run any apache pig code from the terminal everythig goes well and i get the result. So i conclude that my installation for Pig 0.15.0 and Hadoop 2.7.0 is alright. The problem is when i r...
I am trying to Run Embedded Pig in Java. My pig version is 0.15 and my Hadoop version is 2.7.1. By default Embedded pig runs in Hadoop 0.20 version in apache pig site i read that to make pig use ...
I am getting ConnectionRefused error when I am running pig in mapreduce mode. Details: I have installed Pig from tarball( pig-0.14), and exported the classpath in bashrc. I have all the Hadoop (...
I am an absolute beginner in Hadoop, and I am only doing some simple testing, however, I do not find error messages very informative. I have set up my Hadoop environment in a single-node mode on a
I wrote a simple program to test the embedded pig in java to run in mapreduce mode. The hadoop version in the server I am running is 0.20.2-cdh3u4a, and pig version is 0.10.0-cdh3u4a. When I try t...
Using Pig 0.10.1, I have the following script: br = LOAD 'cfs:///somefile'; SPLIT br INTO s0 IF (sp == 1), not_s0 OTHERWISE; SPLIT not_s0 INTO s1 IF (adp &gt;= 1.0), not_s1 OTHERWISE; SPLIT not_s...
I am testing hadoop, as of now I have : 1) localhost:8088 working 2) localhost:50070 working 3) I created a few files on hdfs Then I launch pig, and do a LOAD on a file, and then a FILTER, and...
I have just started with Pig learning for which I installed a pseudo distributed Hadoop 2.7.2 on Ubuntu 14.04 LTS with Pig version 0.16.0. Following are my configurations for PIG and Hadoop - Fil...
Im facing an issue while running a MapReduce program using Hadoop 2 (YARN) and Pig. I'm able to read data from Cassandra using Pig script, however when running MapReduce, it is throwing the excepti...
When I execute the below dump command, it stop in the 0% complete and not continuing for next step. How to track the issue . grunt&gt; a = load '/user/hduser1/file1' using PigStorage(',') as (user...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.