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

PIG_OPTS doesn't support argument with spaces (enclosed within quotes)

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 0.12.0
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
      None

      Description

      I am trying to pass PIG_OPTS="-XX:OnOutOfMemoryError=\"kill -9 %p\"" argument to pig-script. I am getting the following error:

      Unrecognized option: -9
      Error: Could not create the Java Virtual Machine.
      Error: A fatal exception has occurred. Program will exit.

      Using set -x in hadoop script, I found that PIG_OPTS argument passed to pig-script (which calls the hadoop script) is not passed in correctly (see below on how kill command is split on spaces):

      /usr/java/latest/bin/java -Xmx1000m '-XX:OnOutOfMemoryError="kill' -9 '%p"' -Dpig.log.dir=/home/hadoop/pig/logs -Dpig.log.file=pig.log -Dpig.home.dir=/home/hadoop/pig -server -Dhadoop.log.dir=/home/hadoop/logs -Dhadoop.log.file=hadoop.log -Dhadoop.home.dir=/home/hadoop -Dhadoop.id.str= -Dhadoop.root.logger=INFO,console -Djava.library.path=/home/hadoop/lib/native -Dhadoop.policy.file=hadoop-policy.xml -Djava.net.preferIPv4Stack=true -XX:MaxPermSize=128m -Dhadoop.security.logger=INFO,NullAppender -Dsun.net.inetaddr.ttl=30 org.apache.hadoop.util.RunJar /home/hadoop/pig/pig-0.12.0-withouthadoop.jar

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vishnu vishnu gajendran
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: