Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-9660

[WINDOWS] Powershell / cmd parses -Dkey=value from command line as [-Dkey, value] which breaks GenericsOptionParser

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1-win, 2.3.0
    • scripts, util
    • None
    • Reviewed

    Description

      When parsing parameters to a class implementing Tool, and using ToolRunner, we can pass

      bin/hadoop <tool_class> -Dkey=value 
      

      However, powershell parses the '=' sign itself, and sends it to java as ["-Dkey", "value"] which breaks GenericOptionsParser.

      Using "-Dkey=value" or '-Dkey=value' does not fix the problem. The only workaround seems to trick PS by using:
      '"-Dkey=value"' (single + double quote)

      In cmd, "-Dkey=value" works, but not '"-Dkey=value"'.

      http://stackoverflow.com/questions/4940375/how-do-i-pass-an-equal-sign-when-calling-a-batch-script-in-powershell

      Attachments

        1. hadoop-9660-branch1_v3-addendum.patch
          3 kB
          Enis Soztutar
        2. hadoop-9660-branch2_v3.patch
          7 kB
          Enis Soztutar
        3. hadoop-9660-branch1_v3.patch
          7 kB
          Enis Soztutar
        4. hadoop-9660-branch2_v2.patch
          7 kB
          Enis Soztutar
        5. hadoop-9660-branch1_v2.patch
          7 kB
          Enis Soztutar
        6. hadoop-9660-branch2_v1.patch
          7 kB
          Enis Soztutar
        7. hadoop-9660-branch1_v1.patch
          6 kB
          Enis Soztutar

        Issue Links

          Activity

            People

              enis Enis Soztutar
              enis Enis Soztutar
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: