Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-93

Impossible to set jobconf parameters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 0.1.0
    • 0.1.0
    • impl
    • None

    Description

      I'm trying to set jobconf parameter before launching a pig job using pig api.

      I tried 2 different ways but with no success:

      PigContext pigContext = new PigContext(ExecType.MAPREDUCE);
      pigContext.getExecutionEngine().getConfiguration().putAll(properties);
      PigServer pigServer = new PigServer(pigContext);
      ....
      

      Throw a NPE because the internal executionEngine var is initialize only when calling connect().

      So I tried:

      PigContext pigContext = new PigContext(ExecType.MAPREDUCE);
      pigContext.connect();
      pigContext.getExecutionEngine().getConfiguration().putAll(properties);
      PigServer pigServer = new PigServer(pigContext);
      ...
      

      My properties have been replace with a "new JobConf()"

      java.lang.RuntimeException: Bad mapred.job.tracker: local
      at org.apache.hadoop.mapred.JobTracker.getAddress(JobTracker.java:711)
      at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.init(HExecutionEngine.java:149)
      at org.apache.pig.impl.PigContext.connect(PigContext.java:180)
      

      "properties" contains "mapred.job.tracker" and "hadoop.tmp.dir values"

      Before PIG-32 I use to do (and it was working):

      PigContext pigContext = new PigContext(ExecType.MAPREDUCE);
      pigContext.setConf(myJobConf);
      PigServer pigServer = new PigServer(pigContext);
      ...
      

      Any idea before I start to work on a patch ?

      Attachments

        1. PIG93Main.java
          2 kB
          Benjamin Francisoud

        Issue Links

          Activity

            People

              francisoud Benjamin Francisoud
              francisoud Benjamin Francisoud
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: