Pig
  1. Pig
  2. PIG-2543

PigStats.isSuccessful returns false if embedded pig script has sh commands

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.1, 0.10.0
    • Fix Version/s: 0.10.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      For the below script even though the command is successful, result.isSuccessful() returns false and hence raise exception

      #!/usr/bin/python
      from org.apache.pig.scripting import Pig
      Q = Pig.compile("sh echo mymessage")
      result = Q.bind().runSingle()
      if result.isSuccessful() :
          print 'Pig job succeeded'
      else :
          raise 'Cant run sh command'
      
      1. PIG-2543-1.patch
        4 kB
        Daniel Dai
      2. PIG-2543-2.patch
        4 kB
        Daniel Dai

        Activity

        Vivek Padmanabhan created issue -
        Thomas Weise made changes -
        Field Original Value New Value
        Fix Version/s 0.10 [ 12316246 ]
        Hide
        Daniel Dai added a comment -

        The current design of PigStats is all based on mapreduce jobs. It does not have the position for "sh" commands. I propose to adding a flag auxiliaryErrors to PigStats to track non mapreduce errors, and isSuccessful returns true only if all mapreduce job success and no auxiliaryErrors.

        Show
        Daniel Dai added a comment - The current design of PigStats is all based on mapreduce jobs. It does not have the position for "sh" commands. I propose to adding a flag auxiliaryErrors to PigStats to track non mapreduce errors, and isSuccessful returns true only if all mapreduce job success and no auxiliaryErrors.
        Hide
        Daniel Dai added a comment -

        For this particular issue, we don't need to change PigStats interface. All we need is to return success if no mapreduce job is running. I change "sh" command so it throws exception when error occur. This is in par with "fs" and "sql" command.

        Show
        Daniel Dai added a comment - For this particular issue, we don't need to change PigStats interface. All we need is to return success if no mapreduce job is running. I change "sh" command so it throws exception when error occur. This is in par with "fs" and "sql" command.
        Daniel Dai made changes -
        Attachment PIG-2543-1.patch [ 12517483 ]
        Hide
        Daniel Dai added a comment -

        PIG-2543-2.patch fix unit test failures.

        Show
        Daniel Dai added a comment - PIG-2543 -2.patch fix unit test failures.
        Daniel Dai made changes -
        Attachment PIG-2543-2.patch [ 12518134 ]
        Hide
        Thejas M Nair added a comment -

        +1

        Show
        Thejas M Nair added a comment - +1
        Hide
        Daniel Dai added a comment -

        Patch committed to 0.10/trunk.

        Show
        Daniel Dai added a comment - Patch committed to 0.10/trunk.
        Daniel Dai made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Assignee Daniel Dai [ daijy ]
        Resolution Fixed [ 1 ]
        Daniel Dai made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Daniel Dai
            Reporter:
            Vivek Padmanabhan
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development