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

API interface to Pig

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.8.0
    • None
    • None
    • Reviewed
    • A new API (org.apache.pig.PigRunner) is added that allows users to execute a Pig script within a Java program and gets a PigStats object as a return value.
    • documentation

    Description

      It would be nice to make Pig more friendly for applications like workflow that would be executing pig scripts on user behalf.

      Currently, they would have to use pig command line to execute the code; however, this has limitation on the kind of output that would be delivered. For instance, it is hard to produce error information that is easy to use programatically or collect statistics.

      The proposal is to create a class that mimics the behavior of the Main but gives users a status object back. The the main code of pig would look somethig like:

      public static void main(String args[])
      {
      PigStatus ps = PigMain.exec(args);
      exit (PigStatus.rc);
      }

      We need to define the following:

      • Content of PigStatus. It should at least include
      • return code
      • error string
      • exception
      • statistics
      • A way to propagate the status class through pig code

      Attachments

        1. PIG-1333.patch
          292 kB
          Richard Ding
        2. PIG-1333_1.patch
          184 kB
          Richard Ding
        3. PIG-1333_2.patch
          184 kB
          Richard Ding
        4. PIG-1333_3.patch
          186 kB
          Richard Ding

        Activity

          People

            rding Richard Ding
            olgan Olga Natkovich
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: